diff --git a/swh/core/pytest_plugin.py b/swh/core/pytest_plugin.py --- a/swh/core/pytest_plugin.py +++ b/swh/core/pytest_plugin.py @@ -159,10 +159,10 @@ cb = partial(get_response_cb, ignore_urls=ignore_urls, datadir=datadir) - requests_mock.get(re.compile('https://'), body=cb) + requests_mock.get(re.compile('http[s]{0,1}://'), body=cb) else: visits = {} - requests_mock.get(re.compile('https://'), body=partial( + requests_mock.get(re.compile('http[s]{0,1}://'), body=partial( get_response_cb, ignore_urls=ignore_urls, visits=visits, datadir=datadir) ) diff --git a/swh/core/tests/test_pytest_plugin.py b/swh/core/tests/test_pytest_plugin.py --- a/swh/core/tests/test_pytest_plugin.py +++ b/swh/core/tests/test_pytest_plugin.py @@ -15,6 +15,10 @@ assert response.ok assert response.json() == {'hello': 'you'} + response = requests.get('http://example.com/file.json') + assert response.ok + assert response.json() == {'hello': 'you'} + response = requests.get('https://example.com/file.json') assert response.ok assert response.json() == {'hello': 'world'}