Improve test coverage.

This commit is contained in:
Raymond Hettinger 2004-09-29 08:03:17 +00:00
parent 5497feefac
commit bcab2b25f9
2 changed files with 116 additions and 5 deletions

View file

@ -18,8 +18,20 @@ class ListTest(list_tests.CommonTest):
self.assertEqual(len([0]), 1)
self.assertEqual(len([0, 1, 2]), 3)
def test_main():
def test_main(verbose=None):
test_support.run_unittest(ListTest)
if __name__=="__main__":
test_main()
# verify reference counting
import sys
if verbose and hasattr(sys, "gettotalrefcount"):
import gc
counts = [None] * 5
for i in xrange(len(counts)):
test_support.run_unittest(ListTest)
gc.collect()
counts[i] = sys.gettotalrefcount()
print counts
if __name__ == "__main__":
test_main(verbose=True)