22import os
33import markdown
44import difflib
5- import codecs
65import pytest
76import copy
87from . import util
@@ -55,15 +54,15 @@ def check_markdown(testfile, extension, extension_config, wrapper, update=False)
5554 """Check the markdown."""
5655
5756 expected_html = os .path .splitext (testfile )[0 ] + '.html'
58- with codecs . open (testfile , 'r' , encoding = 'utf-8' ) as f :
57+ with open (testfile , 'r' , encoding = 'utf-8' ) as f :
5958 source = f .read ()
6059
6160 results = wrapper % markdown .Markdown (
6261 extensions = extension , extension_configs = extension_config
6362 ).convert (source )
6463
6564 try :
66- with codecs . open (expected_html , 'r' , encoding = 'utf-8' ) as f :
65+ with open (expected_html , 'r' , encoding = 'utf-8' ) as f :
6766 expected = f .read ().replace ("\r \n " , "\n " )
6867 except Exception :
6968 expected = ''
@@ -80,7 +79,7 @@ def check_markdown(testfile, extension, extension_config, wrapper, update=False)
8079 if diff :
8180 if update :
8281 print ('Updated: %s' % expected_html )
83- with codecs . open (expected_html , 'w' , encoding = 'utf-8' ) as f :
82+ with open (expected_html , 'w' , encoding = 'utf-8' ) as f :
8483 f .write (results )
8584 else :
8685 raise Exception (
@@ -100,7 +99,7 @@ def gather_test_params():
10099 if os .path .exists (cfg_path ):
101100 files .remove ('tests.yml' )
102101 [files .remove (file ) for file in files [:] if not file .endswith ('.txt' )]
103- with codecs . open (cfg_path , 'r' , encoding = 'utf-8' ) as f :
102+ with open (cfg_path , 'r' , encoding = 'utf-8' ) as f :
104103 cfg = util .yaml_load (f .read ())
105104 for testfile in files :
106105 key = os .path .splitext (testfile )[0 ]
0 commit comments