Skip to main content

Raise errors when communicating outside of tests

Project description

An experimental nose plugin to block access to external services that you really should not be accessing in your unit tests.

To use:

pip install nose-blockage

Then add the following to your tests:

--with-blockage

By default it whitelists localhost and 127.0.0.1. To change the whitelist:

--http-whitelist=some.site,some.other.site

If the code hits a http connection then instead of completing it will raise a MockHTTPCall exception. Please go an mock your tests appropriately.

To come, maybe more libs.

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

nose-blockage-0.1.1.tar.gz (2.3 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