Skip to content

Commit d6704f9

Browse files
committed
fix: Use modern pytest collection_path parameter and return None
- Replace deprecated 'path' parameter with 'collection_path' in pytest_ignore_collect - Return None instead of False to let pytest use default behavior - This should fix the issue where pytest was collecting tests from .tox/.pkg/
1 parent 8313ad7 commit d6704f9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ def isolate_logging():
4545

4646

4747
# Safe to remove when we drop Python 3.7 support
48-
def pytest_ignore_collect(path, config):
48+
def pytest_ignore_collect(collection_path, config):
4949
"""Ignore async test files on Python 3.7 since Starlette requires Python 3.8+"""
5050
if sys.version_info >= (3, 8):
51-
return False
51+
return None # Let pytest decide (default behavior)
5252

5353
# Skip test_aio.py entirely on Python 3.7
54-
if path.basename == "test_aio.py":
54+
if collection_path.name == "test_aio.py":
5555
return True
5656

57-
return False
57+
return None # Let pytest decide (default behavior)
5858

5959

6060
# Safe to remove when we drop Python 3.7 support

0 commit comments

Comments
 (0)