From 1359b82dd3a718f014bbec4501d270b627428e0c Mon Sep 17 00:00:00 2001 From: Matthew Brett Date: Mon, 25 Sep 2023 13:50:03 +0100 Subject: [PATCH] Use super for output checker inheritance Remove previous workarounds for Python 2 old-style classes. --- pytest_doctestplus/output_checker.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pytest_doctestplus/output_checker.py b/pytest_doctestplus/output_checker.py index ca6345f..c3473fb 100644 --- a/pytest_doctestplus/output_checker.py +++ b/pytest_doctestplus/output_checker.py @@ -43,8 +43,6 @@ class OutputChecker(doctest.OutputChecker): rtol = 1e-05 atol = 1e-08 - _original_output_checker = doctest.OutputChecker - _str_literal_re = re.compile( r"(\W|^)[uU]([rR]?[\'\"])", re.UNICODE) _byteorder_re = re.compile( @@ -281,18 +279,13 @@ def check_output(self, want, got, flags): if flags & FLOAT_CMP: return self.normalize_floats(want, got, flags) - # Can't use super here because doctest.OutputChecker is not a - # new-style class. - return self._original_output_checker.check_output( - self, want, got, flags) + return self(super).check_output(want, got, flags) def output_difference(self, want, got, flags): if flags & FIX: want, got = self.do_fixes(want, got) - # Can't use super here because doctest.OutputChecker is not a - # new-style class. - return self._original_output_checker.output_difference( + return self(super).output_difference( self, want, got, flags)