We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
disable_network
The following test passes:
import urllib.request import pytest @pytest.fixture def some_network_resource() -> str: with urllib.request.urlopen( "https://github.com/best-doctor/pytest_network" ) as response: return response.read().decode() @pytest.mark.disable_network def test_network_disabled(some_network_resource: str) -> None: assert some_network_resource
The expected behavior is a failure.
The fixture runs before the pytest_runtest_call hook:
pytest_network/pytest_network.py
Line 52 in 4e98d81
Change L52 above to pytest_runtest_setup:
pytest_runtest_setup
def pytest_runtest_setup(item):
See also:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Env.
Case
The following test passes:
The expected behavior is a failure.
Explanation
The fixture runs before the pytest_runtest_call hook:
pytest_network/pytest_network.py
Line 52 in 4e98d81
Proposed solution
Change L52 above to
pytest_runtest_setup
:See also:
The text was updated successfully, but these errors were encountered: