Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
This removes an extraneous test package that doesn't exist and also c…
…ode cleanup.

For the new test arguments they were made keyword only and also test_multiprocessing was removed from the SPLITTESTDIRS. The argument splittestdirs was renamed to split_test_dirs for findtests.
  • Loading branch information
zitterbewegung committed Apr 29, 2023
commit 19c6c73959eb9124440fa17eb614cf20d3105fb9
7 changes: 3 additions & 4 deletions Lib/test/libregrtest/runtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def __str__(self) -> str:

SPLITTESTDIRS = {
"test_asyncio",
"test_multiprocessing",
}

# Storage of uncollectable objects
Expand All @@ -167,7 +166,7 @@ def findtestdir(path=None):
return path or os.path.dirname(os.path.dirname(__file__)) or os.curdir


def findtests(testdir=None, stdtests=STDTESTS, nottests=NOTTESTS, splittestdirs=SPLITTESTDIRS, base_mod=""):
def findtests(testdir=None, stdtests=STDTESTS, nottests=NOTTESTS, *, split_test_dirs=SPLITTESTDIRS, base_mod=""):
"""Return a list of all applicable test modules."""
testdir = findtestdir(testdir)
names = os.listdir(testdir)
Expand All @@ -176,13 +175,13 @@ def findtests(testdir=None, stdtests=STDTESTS, nottests=NOTTESTS, splittestdirs=
for name in names:
mod, ext = os.path.splitext(name)
if mod[:5] == "test_" and mod not in others:
if mod in splittestdirs:
if mod in split_test_dirs:
subdir = os.path.join(testdir, mod)
if len(base_mod):
mod = f"{base_mod}.{mod}"
else:
mod = f"test.{mod}"
tests.extend(findtests(subdir, [], nottests, splittestdirs, mod))
tests.extend(findtests(subdir, [], nottests, split_test_dirs=split_test_dirs, base_mod=mod))
elif ext in (".py", ""):
tests.append(f"{base_mod}.{mod}" if len(base_mod) else mod)
return stdtests + sorted(tests)
Expand Down