mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Bug 772091: doctest.DocTestSuite does not support __test__
This got fixed "by magic" as part of the refactoring, but wasn't tested as such. Now it is.
This commit is contained in:
parent
2a7dedef9e
commit
1e277ee3bd
2 changed files with 29 additions and 16 deletions
|
@ -1,9 +1,9 @@
|
|||
"""This is a sample module that doesn't really test anything all that
|
||||
interesting
|
||||
interesting.
|
||||
|
||||
It simply has a few tests, some of which suceed and some of which fail.
|
||||
It simply has a few tests, some of which succeed and some of which fail.
|
||||
|
||||
It's important that the numbers remain constance, as another test is
|
||||
It's important that the numbers remain constant as another test is
|
||||
testing the running of these tests.
|
||||
|
||||
|
||||
|
@ -61,6 +61,16 @@ def y_is_one():
|
|||
1
|
||||
"""
|
||||
|
||||
__test__ = {'good': """
|
||||
>>> 42
|
||||
42
|
||||
""",
|
||||
'bad': """
|
||||
>>> 42
|
||||
666
|
||||
""",
|
||||
}
|
||||
|
||||
def test_suite():
|
||||
import doctest
|
||||
return doctest.DocTestSuite()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue