diff --git a/tests/test_fixity.py b/tests/test_fixity.py index 689d7cb..a89d917 100644 --- a/tests/test_fixity.py +++ b/tests/test_fixity.py @@ -381,8 +381,8 @@ def test_scanall_handles_exceptions(_get, capsys): @mock.patch("requests.get") -@mock.patch("fixity.fixity.main.session", return_value=SESSION) -def test_main(_session, _get, monkeypatch, foobar): +@mock.patch.object(fixity, "Session", lambda: SESSION) +def test_main(_get, monkeypatch, foobar): _get.side_effect = foobar monkeypatch.setenv("STORAGE_SERVICE_URL", STORAGE_SERVICE_URL) monkeypatch.setenv("STORAGE_SERVICE_USER", STORAGE_SERVICE_USER)