summaryrefslogtreecommitdiffstats
path: root/Lib/test/libregrtest/runtest.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/libregrtest/runtest.py')
-rw-r--r--Lib/test/libregrtest/runtest.py35
1 files changed, 15 insertions, 20 deletions
diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py
index c0cfa53..a957492 100644
--- a/Lib/test/libregrtest/runtest.py
+++ b/Lib/test/libregrtest/runtest.py
@@ -1,6 +1,7 @@
import collections
import faulthandler
import functools
+import gc
import importlib
import io
import os
@@ -8,6 +9,7 @@ import sys
import time
import traceback
import unittest
+
from test import support
from test.libregrtest.refleak import dash_R, clear_caches
from test.libregrtest.save_env import saved_test_environment
@@ -59,7 +61,7 @@ NOTTESTS = set()
# used by --findleaks, store for gc.garbage
-found_garbage = []
+FOUND_GARBAGE = []
def format_test_result(result):
@@ -182,11 +184,6 @@ def runtest(ns, test_name):
return TestResult(test_name, FAILED, 0.0, None)
-def post_test_cleanup():
- support.gc_collect()
- support.reap_children()
-
-
def _test_module(the_module):
loader = unittest.TestLoader()
tests = loader.loadTestsFromModule(the_module)
@@ -224,21 +221,19 @@ def _runtest_inner2(ns, test_name):
finally:
cleanup_test_droppings(test_name, ns.verbose)
- if ns.findleaks:
- import gc
- support.gc_collect()
- if gc.garbage:
- import gc
- gc.garbage = [1]
- print_warning(f"{test_name} created {len(gc.garbage)} "
- f"uncollectable object(s).")
- # move the uncollectable objects somewhere,
- # so we don't see them again
- found_garbage.extend(gc.garbage)
- gc.garbage.clear()
- support.environment_altered = True
+ support.gc_collect()
+
+ if gc.garbage:
+ support.environment_altered = True
+ print_warning(f"{test_name} created {len(gc.garbage)} "
+ f"uncollectable object(s).")
- post_test_cleanup()
+ # move the uncollectable objects somewhere,
+ # so we don't see them again
+ FOUND_GARBAGE.extend(gc.garbage)
+ gc.garbage.clear()
+
+ support.reap_children()
return refleak
g_547989 Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful.
summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdMZ.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-04 10:51:00 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-04 10:51:00 (GMT)
commit9e6725acf0dcc249a33a22654ac21f3e1ec42de8 (patch)
tree0fec8c7f2acfd218238c4f65771d849440f1b44e /generic/tclCmdMZ.c
parent9088907888b8deb7fcd5748c0dcc4472130ee10b (diff)
downloadtcl-9e6725acf0dcc249a33a22654ac21f3e1ec42de8.zip
tcl-9e6725acf0dcc249a33a22654ac21f3e1ec42de8.tar.gz
tcl-9e6725acf0dcc249a33a22654ac21f3e1ec42de8.tar.bz2
Eliminate all Tcl_ConvertToType calls and all direct calls to typePtr->setFromAnyProc (except the call from inside the Tcl_ConvertToType function) from the Tcl core.