diff options
Diffstat (limited to 'Lib/test/test_genexps.py')
-rw-r--r-- | Lib/test/test_genexps.py | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/Lib/test/test_genexps.py b/Lib/test/test_genexps.py index 70fe2bb..4f2d3cd 100644 --- a/Lib/test/test_genexps.py +++ b/Lib/test/test_genexps.py @@ -1,3 +1,8 @@ +import sys +import doctest +import unittest + + doctests = """ Test simple loop with conditional @@ -274,28 +279,16 @@ Verify that genexps are weakly referencable """ -import sys - # Trace function can throw off the tuple reuse test. if hasattr(sys, 'gettrace') and sys.gettrace(): __test__ = {} else: __test__ = {'doctests' : doctests} -def test_main(verbose=None): - from test import support - from test import test_genexps - support.run_doctest(test_genexps, verbose) - - # verify reference counting - if verbose and hasattr(sys, "gettotalrefcount"): - import gc - counts = [None] * 5 - for i in range(len(counts)): - support.run_doctest(test_genexps, verbose) - gc.collect() - counts[i] = sys.gettotalrefcount() - print(counts) +def load_tests(loader, tests, pattern): + tests.addTest(doctest.DocTestSuite()) + return tests + if __name__ == "__main__": - test_main(verbose=True) + unittest.main() |