An open API service indexing awesome lists of open source software.

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

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.