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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file pytest_import_check-0.0.4.tar.gz.

File metadata

  • Download URL: pytest_import_check-0.0.4.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pytest_import_check-0.0.4.tar.gz
Algorithm Hash digest
SHA256 7b4fae8e7b862ed8bf69d31dd85e472a0800c37a04d19c62d848d67e50e52e4a
MD5 3261bb2f565c5b30a039df9044eca4f1
BLAKE2b-256 6a484ae61c0f606ed2f94c1bb9717a91fa4c266b97736dcfe41b6c84ce09622f

See more details on using hashes here.

File details

Details for the file pytest_import_check-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_import_check-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 08ca2716464fc11177c974b1d5fc7b1bcb4480470cc3fdab6eb3ca8832e29fd1
MD5 f55accc93ab17714b3eac5e9cc5103bf
BLAKE2b-256 2456ee6a65b8a44e54e6d683db2ef7e4b5ed65cb959eb15222cf64659c6471f4

See more details on using hashes here.

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