Skip to main content

pytest plugin to check whether Python modules can be imported

Project description

Description

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

Thanks

While writing this plugin, I’ve looked at the following linter plugins for inspiration on how to use the API:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_import_check-0.0.4.tar.gz (17.2 kB view hashes)

Uploaded Source

Built Distribution

pytest_import_check-0.0.4-py3-none-any.whl (15.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page