Skip to content

Commit e7e6683

Browse files
committed
fix: Simplify conftest.py.
1 parent 41e7309 commit e7e6683

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

conftest.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ def isolate_logging():
4848
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 None # Let pytest decide (default behavior)
51+
return None
5252

5353
# Skip test_aio.py entirely on Python 3.7
5454
if collection_path.name == "test_aio.py":
5555
return True
5656

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

5959

6060
# Safe to remove when we drop Python 3.7 support
@@ -86,16 +86,8 @@ def pytest_collection_modifyitems(config, items):
8686
skip_test = True
8787
break
8888

89-
# Check test file and function names for async-related test files
90-
test_file = str(item.fspath)
91-
test_name = item.name
92-
93-
# Skip tests in files with async-related keywords
94-
if any(keyword in test_file.lower() for keyword in async_keywords):
95-
skip_test = True
96-
9789
# Skip tests that explicitly test async functionality
98-
if any(keyword in test_name.lower() for keyword in async_keywords):
90+
if any(keyword in item.name.lower() for keyword in async_keywords):
9991
skip_test = True
10092

10193
if skip_test:

0 commit comments

Comments
 (0)