python-mocket
python-mocket copied to clipboard
Feature request: allow specifying exceptions to strict mode
I'm trying to use a library that sends test stats to a remote server in the background [1], and tests that use Mocket in strict mode would fail intermittently when the library tries to make an HTTP request. I'd like to use strict mode to ensure no unexpected requests are made against the service a test is testing, while allowing test stats to be sent to the remote server.
A similar feature is supported (or may get supported) by some other libraries for mocking out HTTP requests when testing:
- HTTPretty's unmerged PR that adds a whitelist feature
-
WebMock, a Ruby library:
disable_net_connect!
method takes anallow
argument
[1]: ddtrace, which sends telemetry data to Datadog's CI Visibility intake server