Skip to content

Commit 90938de

Browse files
committed
fix: systematic approach to resolve pytest collection issues
- Remove unused test dependencies (pytest-mock, responses, pre-commit) - Update pytest.ini with explicit test discovery settings - Add staged test runs in CI to isolate issues - Disable pytest-asyncio plugin explicitly (we don't use async) - Run tests without coverage first to isolate coverage issues - These changes will help identify the root cause of exit code 2
1 parent 425f60a commit 90938de

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,19 @@ jobs:
8080
- name: Run type checking with mypy
8181
run: python -m mypy src tests
8282

83-
- name: Run tests with pytest
83+
- name: Run basic test without coverage
84+
run: |
85+
echo "Running basic test without any plugins:"
86+
python -m pytest tests/test_basic.py -v -p no:asyncio -p no:cov
87+
continue-on-error: true
88+
89+
- name: Run all tests without coverage
90+
run: |
91+
echo "Running all tests without coverage:"
92+
python -m pytest -v -p no:asyncio
93+
continue-on-error: true
94+
95+
- name: Run tests with pytest (with coverage)
8496
run: python -m pytest -v --cov=nutrient_dws --cov-report=xml --cov-report=term
8597

8698
- name: Upload coverage to Codecov

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,8 @@ dependencies = [
4242
dev = [
4343
"pytest>=7.0.0",
4444
"pytest-cov>=4.0.0",
45-
"pytest-mock>=3.10.0",
46-
"responses>=0.22.0",
4745
"mypy>=1.0.0",
4846
"ruff>=0.1.0",
49-
"pre-commit>=3.0.0",
5047
"types-requests>=2.25.0",
5148
]
5249
docs = [

pytest.ini

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
[pytest]
2-
testpaths = tests
2+
testpaths = tests
3+
python_files = test_*.py
4+
python_classes = Test*
5+
python_functions = test_*
6+
addopts = -ra

0 commit comments

Comments
 (0)