Skip to main content

Try to import all modules below a given root

Project description

Contains one essential thing, and a few other minorly useful bits.

ImportAllTest: test that all modules import successfully

Not every file is covered by unit tests, particularly scripts; and unit tests won’t report any new warnings that occur.

ImportAllTest automatically loads each Python file or module reachable from your root directory. Warnings are by default treated as errors.

I drop this into each new project as my first test. It inevitably catches a host of problems, particularly when I’m in rapid development and running a subset of tests.

In the most common usage, just add this tiny file all_test.py. anywhere in your unit test directory:

import import_all


class ImportAllTest(import_all.TestCase):
    pass

You can customize how warnings are treated here.

all_test.py.

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

recs-0.9.2.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file recs-0.9.2.tar.gz.

File metadata

  • Download URL: recs-0.9.2.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.5

File hashes

Hashes for recs-0.9.2.tar.gz
Algorithm Hash digest
SHA256 1a7db2787c9b9d26f3132201f78271e660e43857d8651538f2887ebdf8aaa5b8
MD5 19a1bc3983401642412a4ae18879e9e1
BLAKE2b-256 297b0fcd4235e2dc7f44c76cfb80b3259b95e36c8bb0ce9837f7a119e29c8f83

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