Commit 7d2b9dd
committed
Configure pytest to use importlib import mode
By default, running `pytest` prepends the source directory to the Python
path, since that's where the `tests` package is. That causes Python to
import `openslide` from the source directory instead of using the
installed copy, and this fails because the source directory doesn't have
the compiled extension module. Configure pytest not to change the Python
path, as recommended by pytest docs:
https://docs.pytest.org/en/7.1.x/explanation/goodpractices.html#choosing-an-import-mode
Then, manually set the Python path to allow tests to load common code.
Signed-off-by: Benjamin Gilbert <bgilbert@cs.cmu.edu>1 parent 509af98 commit 7d2b9dd
3 files changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments