Skip to content

Commit 8878e59

Browse files
authored
Merge pull request #208 from bgilbert/pytest
Fix running pytest in root of repo
2 parents fe362fb + 7d2b9dd commit 8878e59

File tree

14 files changed

+18
-14
lines changed

14 files changed

+18
-14
lines changed

.github/workflows/python.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ jobs:
5353
;;
5454
esac
5555
- name: Install
56-
run: pip install -e .
56+
run: pip install .
5757
- name: Run tests
5858
run: pytest -v
5959
- name: Tile slide
60-
run: python examples/deepzoom/deepzoom_tile.py --viewer -o tiled tests/small.svs
60+
run: python examples/deepzoom/deepzoom_tile.py --viewer -o tiled tests/fixtures/small.svs
6161
windows:
6262
name: Windows
6363
needs: pre-commit
@@ -117,7 +117,7 @@ jobs:
117117
python examples/deepzoom/deepzoom_tile.py -h >/dev/null
118118
- name: Tile slide
119119
# Reads OPENSLIDE_PATH
120-
run: python examples/deepzoom/deepzoom_tile.py --viewer -o tiled tests/small.svs
120+
run: python examples/deepzoom/deepzoom_tile.py --viewer -o tiled tests/fixtures/small.svs
121121
- name: Archive wheel
122122
uses: actions/upload-artifact@v3
123123
with:

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
/dist
33
/MANIFEST
44
/*.egg-info
5-
/openslide/_convert*.so
65
*.pyc

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include *.md
1+
include *.md pytest.ini
22
recursive-include doc *.py *.rst
33
recursive-include examples *.html *.js *.png *.py
44
recursive-include tests *.png *.py *.svs *.tiff

pytest.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[pytest]
2+
minversion = 6.0
3+
# don't try to import openslide from the source directory, since it doesn't
4+
# have the compiled extension module
5+
addopts = --import-mode importlib
6+
# allow tests to import common module
7+
pythonpath = tests

tests/__init__.py renamed to tests/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646

4747
def file_path(name):
48-
return Path(__file__).parent / name
48+
return Path(__file__).parent / 'fixtures' / name
4949

5050

5151
def maybe_supported(f):
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)