Skip to content

Commit 9ed67c0

Browse files
committed
test: add conftest file with monkeypatch to block api calls
1 parent cf6b4e3 commit 9ed67c0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

conftest.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# contents of test_app.py, a simple test for our API retrieval
2+
import pytest
3+
import requests
4+
5+
6+
# Prevent `requests` from making any inadvertent API calls in tests
7+
@pytest.fixture(autouse=True)
8+
def no_requests(monkeypatch):
9+
monkeypatch.delattr("requests.sessions.Session.request")

0 commit comments

Comments
 (0)