self.single = False
self.randomize = False
self.fromfile = None
- self.findleaks = 1
self.fail_env_changed = False
self.use_resources = None
self.trace = False
'(instead of the Python stdlib test suite)')
group = parser.add_argument_group('Special runs')
- group.add_argument('-l', '--findleaks', action='store_const', const=2,
- default=1,
- help='deprecated alias to --fail-env-changed')
group.add_argument('-L', '--runleaks', action='store_true',
help='run the leaks(1) command just before exit.' +
more_details)
parser.error("unrecognized arguments: %s" % arg)
sys.exit(1)
- if ns.findleaks > 1:
- # --findleaks implies --fail-env-changed
- ns.fail_env_changed = True
if ns.single and ns.fromfile:
parser.error("-s and -f don't go together!")
if ns.use_mp is not None and ns.trace:
files beginning with test_ will be used.
The other default arguments (verbose, quiet, exclude,
- single, randomize, findleaks, use_resources, trace, coverdir,
+ single, randomize, use_resources, trace, coverdir,
print_slow, and random_seed) allow programmers calling main()
directly to set the values that would normally be set by flags
on the command line.
NOTTESTS = set()
-# used by --findleaks, store for gc.garbage
+# Storage of uncollectable objects
FOUND_GARBAGE = []
def _runtest_inner2(ns: Namespace, test_name: str) -> bool:
# Load the test function, run the test function, handle huntrleaks
- # and findleaks to detect leaks
+ # to detect leaks.
abstest = get_abs_module(ns, test_name)
no_test_ran=[testname])
@support.cpython_only
- def test_findleaks(self):
+ def test_uncollectable(self):
code = textwrap.dedent(r"""
import _testcapi
import gc
env_changed=[testname],
fail_env_changed=True)
- # --findleaks is now basically an alias to --fail-env-changed
- output = self.run_tests("--findleaks", testname, exitcode=3)
- self.check_executed_tests(output, [testname],
- env_changed=[testname],
- fail_env_changed=True)
-
def test_multiprocessing_timeout(self):
code = textwrap.dedent(r"""
import time
--- /dev/null
+Remove the ``--findleaks`` command line option of regrtest: use the
+``--fail-env-changed`` option instead. Since Python 3.7, it was a deprecated
+alias to the ``--fail-env-changed`` option.