pytest-import-check is a pytest plugin that enables checking whether Python modules installed by your package are importable. This is mostly useful to quickly check packages that do not have tests at all or do not have all their modules covered by tests.
To enable it, pass --import-check
option to pytest, e.g.::
pytest --import-check foo
Please note that pytest will still perform the default collection
and run any tests that it can find. Note that this may result in quite
verbose tracebacks. If this is undesirable, you can disable
the built-in python
plugin::
pytest -p no:python --import-check foo
While writing this plugin, I've looked at the following linter plugins for inspiration on how to use the API:
.. _pytest-flakes: https://pypi.org/project/pytest-flakes/ .. _pytest-mypy: https://pypi.org/project/pytest-mypy/