diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-07-03 19:30:49 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-07-03 19:30:49 (GMT) |
commit | bae75cf3fe975d21c0c20baa595d21ebeca54681 (patch) | |
tree | 5d1b8a52a7c505d5eacd37f8525ccb230776ba27 /Lib/test/test_gc.py | |
parent | 7e160ce356036bccda2608d9ee10bfe276dfa97a (diff) | |
parent | a793037d803abf098d172f686e2b95d27863c54d (diff) | |
download | cpython-bae75cf3fe975d21c0c20baa595d21ebeca54681.zip cpython-bae75cf3fe975d21c0c20baa595d21ebeca54681.tar.gz cpython-bae75cf3fe975d21c0c20baa595d21ebeca54681.tar.bz2 |
Issue #19527: Fixed tests with defined COUNT_ALLOCS.
Diffstat (limited to 'Lib/test/test_gc.py')
-rw-r--r-- | Lib/test/test_gc.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py index 872ca62..e727499 100644 --- a/Lib/test/test_gc.py +++ b/Lib/test/test_gc.py @@ -1,7 +1,7 @@ import unittest from test.support import (verbose, refcount_test, run_unittest, - strip_python_stderr, cpython_only, start_threads, - temp_dir) + strip_python_stderr, cpython_only, start_threads, + temp_dir, requires_type_collecting) from test.support.script_helper import assert_python_ok, make_script import sys @@ -118,6 +118,7 @@ class GCTests(unittest.TestCase): del a self.assertNotEqual(gc.collect(), 0) + @requires_type_collecting def test_newinstance(self): class A(object): pass @@ -678,6 +679,7 @@ class GCTests(unittest.TestCase): stderr = run_command(code % "gc.DEBUG_SAVEALL") self.assertNotIn(b"uncollectable objects at shutdown", stderr) + @requires_type_collecting def test_gc_main_module_at_shutdown(self): # Create a reference cycle through the __main__ module and check # it gets collected at interpreter shutdown. @@ -691,6 +693,7 @@ class GCTests(unittest.TestCase): rc, out, err = assert_python_ok('-c', code) self.assertEqual(out.strip(), b'__del__ called') + @requires_type_collecting def test_gc_ordinary_module_at_shutdown(self): # Same as above, but with a non-__main__ module. with temp_dir() as script_dir: |