8000 Correct regression whereby the same test was executed 74 times · html5lib/html5lib-python@688e4c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 688e4c9

Browse files
committed
Correct regression whereby the same test was executed 74 times
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40693
1 parent 2a7e2e0 commit 688e4c9

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/test_encoding.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import sys
22
import os
33
import glob
4-
import StringIO
54
import unittest
6-
import new
7-
import codecs
85

96
#RELEASE remove
10-
# XXX Allow us to import the sibling module
11-
os.chdir(os.path.split(os.path.abspath(__file__))[0])
12-
sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, "src")))
7+
if __name__ == '__main__':
8+
# XXX Allow us to import the sibling module
9+
os.chdir(os.path.split(os.path.abspath(__file__))[0])
10+
sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, "src")))
1311

1412
import inputstream
1513
#END RELEASE
@@ -30,9 +28,9 @@ def buildTestSuite():
3028
for idx,(data,encoding) in enumerate(re.compile(
3129
"^#data\s*\n(.*?)\n#encoding\s*\n(.*?)\n",
3230
re.DOTALL|re.MULTILINE).findall(open(filename).read())):
33-
def encodingTest(self):
31+
def encodingTest(self, data=data, encoding=encoding):
3432
stream = inputstream.HTMLInputStream(data,chardet=False)
35-
assert encoding == stream.charEncoding.lower()
33+
self.assertEquals(encoding.lower(), stream.charEncoding)
3634
setattr(Html5EncodingTestCase, 'test_%s_%d' % (test_name, idx+1),
3735
encodingTest)
3836

0 commit comments

Comments
 (0)
0