Skip to content

Commit 601115c

Browse files
committed
pythongh-109402: Fix libregrtest when module matches folder name
1 parent 1f885df commit 601115c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/libregrtest/findtests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def findtests(*, testdir: StrPath | None = None, exclude=(),
3838
mod, ext = os.path.splitext(name)
3939
if (not mod.startswith("test_")) or (mod in exclude):
4040
continue
41-
if mod in split_test_dirs:
41+
if mod in split_test_dirs and os.path.isdir(mod):
4242
subdir = os.path.join(testdir, mod)
4343
mod = f"{base_mod or 'test'}.{mod}"
4444
tests.extend(findtests(testdir=subdir, exclude=exclude,

0 commit comments

Comments
 (0)