mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
* Update `_compat_pickle.py` from 3.14.2 * Update `pickle.py` from 3.14.2 * Update pickletools and tests * Update all other pickle related files * Make `test_extcall` to use modified doctest checker
25 lines
705 B
Python
Vendored
25 lines
705 B
Python
Vendored
"""
|
|
RustPython specific helpers.
|
|
"""
|
|
|
|
import doctest
|
|
|
|
|
|
# copied from https://github.com/RustPython/RustPython/pull/6919
|
|
EXPECTED_FAILURE = doctest.register_optionflag("EXPECTED_FAILURE")
|
|
|
|
|
|
class DocTestChecker(doctest.OutputChecker):
|
|
"""
|
|
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.
|
|
"""
|
|
|
|
def check_output(self, want, got, optionflags):
|
|
res = super().check_output(want, got, optionflags)
|
|
if optionflags & EXPECTED_FAILURE:
|
|
res = not res
|
|
return res
|