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

Uploaded Source

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