Open mgorny opened 1 year ago
Describe the bug When running the test suite in an environment without Internet access, I'm getting the following test failures:
FAILED tests/test_blocking_network.py::test_block_network_with_allowed_hosts[block_marker] - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} FAILED tests/test_blocking_network.py::test_block_network_with_allowed_hosts[block_cmd] - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} FAILED tests/test_blocking_network.py::test_block_network_with_allowed_hosts[vcr_cfg] - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}
If I'm reading the output right, even though the requests were supposed to be blocked, requests attempts to resolve example.com and fails with NameResolutionError.
example.com
NameResolutionError
Full log: test-output.txt
To Reproduce Steps to reproduce the behavior:
tox -e py311
sudo unshare -n
ifconfig lo up
su - <regularuser>
cd <pytest-recording-checkout>
. .tox/py311/bin/activate
python -m pytest
Expected behavior Tests passing (i.e. no DNS requests should be made if network access is blocked).
Environment (please complete the following information):
Additional context n/a
Describe the bug When running the test suite in an environment without Internet access, I'm getting the following test failures:
If I'm reading the output right, even though the requests were supposed to be blocked, requests attempts to resolve
example.com
and fails withNameResolutionError
.Full log: test-output.txt
To Reproduce Steps to reproduce the behavior:
tox -e py311
(or alike) to prepare the test envsudo unshare -n
ifconfig lo up
su - <regularuser>
cd <pytest-recording-checkout>
. .tox/py311/bin/activate
python -m pytest
Expected behavior Tests passing (i.e. no DNS requests should be made if network access is blocked).
Environment (please complete the following information):
Additional context n/a