diff options
author | Zachary Ware <zachary.ware@gmail.com> | 2013-11-24 07:19:09 (GMT) |
---|---|---|
committer | Zachary Ware <zachary.ware@gmail.com> | 2013-11-24 07:19:09 (GMT) |
commit | a4b7a7548c43d1d7f4fd52129aa32340ca15af6a (patch) | |
tree | 9993a71599cca9dcfbb51dc3286cbb5ab094b455 /Lib/test/test_builtin.py | |
parent | 091167c1ca513d74c7a146d6a527e7b8b07ae7e8 (diff) | |
download | cpython-a4b7a7548c43d1d7f4fd52129aa32340ca15af6a.zip cpython-a4b7a7548c43d1d7f4fd52129aa32340ca15af6a.tar.gz cpython-a4b7a7548c43d1d7f4fd52129aa32340ca15af6a.tar.bz2 |
Issue #3158: doctest can now find doctests in functions and methods
written in C.
As a part of this, a few doctests have been added to the builtins module
(on hex(), oct(), and bin()), a doctest has been fixed (hopefully on all
platforms) on float, and test_builtins now runs doctests in builtins.
Diffstat (limited to 'Lib/test/test_builtin.py')
-rw-r--r-- | Lib/test/test_builtin.py | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index 2411c9b..6843066 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -1592,21 +1592,10 @@ class TestSorted(unittest.TestCase): data = 'The quick Brown fox Jumped over The lazy Dog'.split() self.assertRaises(TypeError, sorted, data, None, lambda x,y: 0) -def test_main(verbose=None): - test_classes = (BuiltinTest, TestSorted) - - run_unittest(*test_classes) - - # verify reference counting - if verbose and hasattr(sys, "gettotalrefcount"): - import gc - counts = [None] * 5 - for i in range(len(counts)): - run_unittest(*test_classes) - gc.collect() - counts[i] = sys.gettotalrefcount() - print(counts) - +def load_tests(loader, tests, pattern): + from doctest import DocTestSuite + tests.addTest(DocTestSuite(builtins)) + return tests if __name__ == "__main__": - test_main(verbose=True) + unittest.main() |