8000 Cope with windows newlines on unix, small improvement in mockTest · awesome-python/html5lib-python@bdcc024 · GitHub
[go: up one dir, main page]

Skip to content

Commit bdcc024

Browse files
committed
Cope with windows newlines on unix, small improvement in mockTest
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40629
1 parent dc590a6 commit bdcc024

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tests/test_serializer.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class simplejson:
1313
def load(f):
1414
true, false = True, False
1515
input=re.sub(r'(".*?(?<!\\)")',r'u\1',f.read().decode('utf-8'))
16-
return eval(input)
16+
return eval(input.replace('\r',''))
1717
load = staticmethod(load)
1818

1919
#RELEASE remove
@@ -44,10 +44,7 @@ def addTest(cls, name, expected, input, description, options):
4444
def mockTest(self, expected, input, options):
4545
exception = None
4646
result = self.serialize_html(input, options)
47-
for alternative in expected:
48-
if alternative == result:
49-
break
50-
else:
47+
if result not in expected:
5148
if options.get("omit_optional_tags", True):
5249
options["omit_optional_tags"] = False
5350
self.assertEquals(self.serialize_html(input, options), result)

0 commit comments

Comments
 (0)
0