Skip to content
Prev Previous commit
Next Next commit
Address review
  • Loading branch information
ShaharNaveh committed Feb 4, 2026
commit a65a1e534d895c6938f125746f90db21b3959c61
8 changes: 6 additions & 2 deletions Lib/test/support/rustpython.py
Copy link
Copy Markdown
Contributor Author

@ShaharNaveh ShaharNaveh Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fanninpm can you please review? I've modified this slightly (renamed the class, and didn't use an if inside the check_output method)

Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@
class DocTestChecker(doctest.OutputChecker):
"""
Custom output checker that lets us to add: `+EXPECTED_FAILURE` for doctest tests.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor grammar nitpick from a native speaker of English:

Suggested change
Custom output checker that lets us to add: `+EXPECTED_FAILURE` for doctest tests.
Custom output checker that lets us add: `+EXPECTED_FAILURE` for doctest tests.

Also, consider expanding upon what exactly this option string does (allows us to mark doctest examples as currently failing, for accountability).


We want to be able to mark failing doctest test the same way we do with normal
unit test, without this class we would have to skip the doctest for the CI to pass.
"""

def check_output(self, want, got, optionflags):
res = super().check_output(want, got, optionflags)
if optionflags & EXPECTED_FAILURE:
return want != got
return super().check_output(want, got, optionflags)
res = not res
return res