Skip to content

Commit

Permalink
Run Pytest in installed package
Browse files Browse the repository at this point in the history
This avoids the `import file mismatch` error from Pytest.
  • Loading branch information
akaihola committed Feb 26, 2024
1 parent 20f8df2 commit d7f4eba
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,20 @@ jobs:
- name: Run Pytest with the Darker plugin on recent Black versions
if: matrix.constraints != '--constraint constraints-oldest.txt'
run: |
pytest --darker
pytest --darker $(python -c "
import os, darker
print(os.path.dirname(darker.__file__))
")
- name: Run Pytest without the Darker plugin on oldest Black version
# The reformatting rules used to be a bit different. We don't need to
# test reformatting Darker's own code base with old Black versions.
# Interoperability is ensured by unit tests.
if: matrix.constraints == '--constraint constraints-oldest.txt'
run: |
pytest
pytest $(python -c "
import os, darker
print(os.path.dirname(darker.__file__))
")
build-sdist-validate-dists:
runs-on: ubuntu-latest
Expand Down

0 comments on commit d7f4eba

Please sign in to comment.