diff --git a/tests/test_requests.py b/tests/test_requests.py index 8f147ae..6c1bb41 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -3,9 +3,17 @@ import requests import pytest - -@pytest.RequestsData("req") -def test_requests(data_json): +def assert_test0(data): res = requests.get('https://example.com/test0') assert res.status_code == 200 - assert data_json.expected == res.json() + assert data.expected == res.json() + + +@pytest.RequestsData("req") +def test_decorator(data_json): + assert_test0(data_json) + + +def test_context(data_json): + with pytest.RequestsData("req"): + assert_test0(data_json)