mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Mark failing tests
This commit is contained in:
1 parent
553be2af33
commit
2bb027ac6a
1 file changed
+13
-4
Vendored
+13
-4
@@ -305,14 +305,14 @@ is *not* valid syntax.)
|
||||
{'args': StarredB}
|
||||
|
||||
>>> def f3(*args: *b, arg1: int): pass
|
||||
>>> f3.__annotations__
|
||||
>>> f3.__annotations__ # TODO: RUSTPYTHON # doctest: +EXPECTED_FAILURE
|
||||
{'args': StarredB, 'arg1': <class 'int'>}
|
||||
|
||||
>>> def f4(*args: *b, arg1: int = 2): pass
|
||||
>>> f4.__annotations__
|
||||
>>> f4.__annotations__ # TODO: RUSTPYTHON # doctest: +EXPECTED_FAILURE
|
||||
{'args': StarredB, 'arg1': <class 'int'>}
|
||||
|
||||
>>> def f5(*args: *b = (1,)): pass
|
||||
>>> def f5(*args: *b = (1,)): pass # TODO: RUSTPYTHON # doctest: +EXPECTED_FAILURE
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
SyntaxError: invalid syntax
|
||||
@@ -320,8 +320,17 @@ is *not* valid syntax.)
|
||||
|
||||
__test__ = {'doctests' : doctests}
|
||||
|
||||
EXPECTED_FAILURE = doctest.register_optionflag('EXPECTED_FAILURE') # TODO: RUSTPYTHON
|
||||
class CustomOutputChecker(doctest.OutputChecker): # TODO: RUSTPYTHON
|
||||
def check_output(self, want, got, optionflags): # TODO: RUSTPYTHON
|
||||
if optionflags & EXPECTED_FAILURE: # TODO: RUSTPYTHON
|
||||
if want == got: # TODO: RUSTPYTHON
|
||||
return False # TODO: RUSTPYTHON
|
||||
return True # TODO: RUSTPYTHON
|
||||
return super().check_output(want, got, optionflags) # TODO: RUSTPYTHON
|
||||
|
||||
def load_tests(loader, tests, pattern):
|
||||
tests.addTest(doctest.DocTestSuite())
|
||||
tests.addTest(doctest.DocTestSuite(checker=CustomOutputChecker())) # TODO: RUSTPYTHON
|
||||
return tests
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user