Skip to content

Commit 425f60a

Browse files
committed
debug: add comprehensive CI debugging for pytest collection failure
- Add environment checks to CI workflow - Test package imports directly - Add pytest collection dry run with continue-on-error - Simplify pytest.ini to absolute minimum - Add basic test that doesn't import our package - This will help us understand why pytest fails with exit code 2
1 parent 934973f commit 425f60a

File tree

3 files changed

+45
-6
lines changed

3 files changed

+45
-6
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,44 @@ jobs:
3434
python -m pip install --upgrade pip
3535
pip install -e ".[dev]"
3636
37+
- name: Debug - Check environment
38+
run: |
39+
echo "Python version:"
40+
python --version
41+
echo "Python path:"
42+
which python
43+
echo "Site packages:"
44+
python -c "import site; print(site.getsitepackages())"
45+
echo "Current directory:"
46+
pwd
47+
echo "Directory contents:"
48+
ls -la
49+
echo "Installed packages:"
50+
pip list
51+
52+
- name: Debug - Test package import
53+
run: |
54+
echo "Testing direct import:"
55+
python -c "import nutrient_dws; print('Import successful:', nutrient_dws.__version__)"
56+
echo "Testing submodule imports:"
57+
python -c "from nutrient_dws.client import NutrientClient; print('Client import successful')"
58+
python -c "from nutrient_dws.exceptions import NutrientError; print('Exceptions import successful')"
59+
60+
- name: Debug - Check test structure
61+
run: |
62+
echo "Test directory structure:"
63+
find tests -name "*.py" -type f
64+
echo "Test __init__ files:"
65+
find tests -name "__init__.py" -type f
66+
echo "Python path:"
67+
python -c "import sys; print('\n'.join(sys.path))"
68+
69+
- name: Debug - pytest collection dry run
70+
run: |
71+
echo "Running pytest collection only:"
72+
python -m pytest --collect-only -v
73+
continue-on-error: true
74+
3775
- name: Run linting with ruff
3876
run: |
3977
python -m ruff check .

pytest.ini

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
[pytest]
2-
minversion = 7.0
3-
testpaths = tests
4-
addopts = -ra --strict-markers
5-
asyncio_mode = auto
6-
markers =
7-
integration: marks tests as integration tests (deselect with '-m "not integration"')
2+
testpaths = tests

tests/test_basic.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""Most basic test possible to debug pytest collection."""
2+
3+
4+
def test_true():
5+
"""Simplest possible test."""
6+
assert True

0 commit comments

Comments
 (0)