Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pytest_doctestplus/output_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ class OutputChecker(doctest.OutputChecker):
r"([0-9]+)L", re.UNICODE)

def __init__(self):
# NOTE OutputChecker is an old-style class with no __init__ method,
# so we can't call the base class version of __init__ here

exp = r'(?:e[+-]?\d+)'

got_floats = (r'\s*([+-]?\d+\.\d*{0}?|'
Expand All @@ -78,6 +75,10 @@ def __init__(self):
fmidend = r'(?<={}){}(?={}|$)'.format(front_sep, want_floats, back_sep)
self.num_want_rgx = re.compile(r'({}|{})'.format(fbeg, fmidend))

# As of 2023-09-26, Python base class has no init, but just in case
# it acquires one.
super().__init__()

def do_fixes(self, want, got):
want = re.sub(self._str_literal_re, r'\1\2', want)
want = re.sub(self._byteorder_re, r'\1\2\3', want)
Expand Down