Skip to content

Commit

Permalink
I see the issue now. The problem is that pytest is trying to import c…
Browse files Browse the repository at this point in the history
…onf.py as a test file, and recommonmark isn't installed in the test environment. We need to:

Tell pytest to ignore the docs directory
Make sure recommonmark is installed in both environments
First, create or update your pytest.ini file:
pytest.ini
Then update your python-package.yml workflow to include recommonmark in the test dependencies:
python-package.yml
This should:
Prevent pytest from trying to import conf.py as a test file
Ensure recommonmark is available in both the test and documentation environments
  • Loading branch information
endolith committed Nov 18, 2024
1 parent b29f36e commit 826b170
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
pip install flake8 pytest pytest-cov recommonmark
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f docs/requirements.txt ]; then pip install -r docs/requirements.txt; fi
- name: Install package
run: |
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ addopts =
doctest_optionflags = ELLIPSIS
env =
D:NUMBA_DISABLE_JIT=1
testpaths = tests
norecursedirs = docs

0 comments on commit 826b170

Please sign in to comment.