MCPcopy Index your code
hub / github.com/RustPython/RustPython / DocTestChecker

Class DocTestChecker

Lib/test/support/rustpython.py:12–24  ·  view source on GitHub ↗

Custom output checker that lets us add: `+EXPECTED_FAILURE` for doctest tests. 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.

Source from the content-addressed store, hash-verified

10
11
12class DocTestChecker(doctest.OutputChecker):
13 """
14 Custom output checker that lets us add: `+EXPECTED_FAILURE` for doctest tests.
15
16 We want to be able to mark failing doctest test the same way we do with normal
17 unit test, without this class we would have to skip the doctest for the CI to pass.
18 """
19
20 def check_output(self, want, got, optionflags):
21 res = super().check_output(want, got, optionflags)
22 if optionflags & EXPECTED_FAILURE:
23 res = not res
24 return res

Callers 6

load_testsFunction · 0.90
load_testsFunction · 0.90
load_testsFunction · 0.90
load_testsFunction · 0.90
load_testsFunction · 0.90
load_testsFunction · 0.90

Calls

no outgoing calls

Tested by 6

load_testsFunction · 0.72
load_testsFunction · 0.72
load_testsFunction · 0.72
load_testsFunction · 0.72
load_testsFunction · 0.72
load_testsFunction · 0.72