mirror of
https://github.com/python/cpython.git
synced 2025-09-10 18:58:35 +00:00
Remove functionality from test_datetime.test_main() that does reference count checking; 'regrtest.py -R' is the way to do this kind of testing.
This commit is contained in:
parent
c2898c5a67
commit
bec754c2b5
1 changed files with 1 additions and 20 deletions
|
@ -3249,26 +3249,7 @@ class Oddballs(unittest.TestCase):
|
||||||
self.assertEqual(datetime_sc, as_datetime)
|
self.assertEqual(datetime_sc, as_datetime)
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
import gc
|
test_support.run_unittest(__name__)
|
||||||
import sys
|
|
||||||
|
|
||||||
lastrc = None
|
|
||||||
while True:
|
|
||||||
test_support.run_unittest(__name__)
|
|
||||||
if 1: # change to 0, under a debug build, for some leak detection
|
|
||||||
break
|
|
||||||
gc.collect()
|
|
||||||
if gc.garbage:
|
|
||||||
raise SystemError("gc.garbage not empty after test run: %r" %
|
|
||||||
gc.garbage)
|
|
||||||
if hasattr(sys, 'gettotalrefcount'):
|
|
||||||
thisrc = sys.gettotalrefcount()
|
|
||||||
print >> sys.stderr, '*' * 10, 'total refs:', thisrc,
|
|
||||||
if lastrc:
|
|
||||||
print >> sys.stderr, 'delta:', thisrc - lastrc
|
|
||||||
else:
|
|
||||||
print >> sys.stderr
|
|
||||||
lastrc = thisrc
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
test_main()
|
test_main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue