Skip to content

Commit

Permalink
fix test to run on windows with windows line endings (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Aug 7, 2020
1 parent 93f7ac7 commit 9a7ad25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/z3c/jbot/tests/test_doctests.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@

class Py23DocChecker(doctest.OutputChecker):
def check_output(self, want, got, optionflags):
# fix windows line-endings to match uix ones in tests
want = want.replace("\r\n", "\n")
# fix binary/unicode differences between python versions
if six.PY2:
want = re.sub("b'(.*?)'", "'\\1'", want)
else:
want = re.sub("u'(.*?)'", "'\\1'", want)
want = want.replace(r"\r\n", r"\n")
return doctest.OutputChecker.check_output(self, want, got, optionflags)


Expand Down

0 comments on commit 9a7ad25

Please sign in to comment.