Skip to main content

A nose plugin to detect tests making http calls.

Project description

A nose plugin that can detect tests making external http calls. Example output:

$ nosetests -v --with-detecthttp myapp/
test_that_makes_request ... ok
test_with_no_request ... ok

FAIL: Tests made external http calls
- myapp.tests.AppTest:


Ran 2 tests in 0.001s

FAILED (failures=1)

Sometimes, you want to ignore hosts besides localhost. For example, you might be running tests in a containerized environment where dynamodb has the hostname dynamodb and mysql has the hostname mysql. To ignore these hosts, the –vcr-ignore-host option:

nosetests -v --with-detecthttp,dynamodb,mysql app/
test_one (app.tests.ExternalTestCase) ... ok
test_two (app.tests.ExternalTestCase) ... ok

Ran 2 tests in 0.042s


Under the hood, this wraps every test in a separate cassette. Since’s hooks are in the stdlib, this approach won’t detect requests made with clients like PycURL.



released 2018-09-12

  • breaking: ignore host flag now accepts comma-separated values rather than being provided multiple times


released 2017-08-15

  • add –vcr-ignore-host option to ignore custom hosts


released 2015-10-16

  • python 3 support


released 2014-11-24

  • initial release

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-detecthttp-1.0.0.tar.gz (5.1 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page