https://github.com/pmeier/pytest-import
Proof of concept for importing test packages when working with pytest's --import-mode=importlib
https://github.com/pmeier/pytest-import
Last synced: about 1 year ago
JSON representation
Proof of concept for importing test packages when working with pytest's --import-mode=importlib
- Host: GitHub
- URL: https://github.com/pmeier/pytest-import
- Owner: pmeier
- Created: 2021-09-21T20:56:40.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-21T21:07:19.000Z (over 4 years ago)
- Last Synced: 2025-02-08T06:42:25.210Z (over 1 year ago)
- Language: Python
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `pytest-import`
This is a proof-of-concept for https://github.com/pytest-dev/pytest/issues/8964#issuecomment-924289234.
The idea is to import test packages on the requested test paths if `pytest` runs with
`--import-mode=importlib`.
## Demo
```shell
$ python setup.py develop
$ pytest --import-mode=importlib tests/
```
Although `tests/test_foo.py` features an import from `tests/utils.py`, we can
`pytest --import-mode=importlib tests/` without error.