From ac891314bfa50e83716a3d3a1964879b0efb83ed Mon Sep 17 00:00:00 2001 From: sturmianseq <88301801+sturmianseq@users.noreply.github.com> Date: Mon, 15 Nov 2021 23:48:06 +0800 Subject: [PATCH] Fix a flaky test by cleaning a polluted state. --- tests/test_api_client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_api_client.py b/tests/test_api_client.py index 03179ee..5740462 100644 --- a/tests/test_api_client.py +++ b/tests/test_api_client.py @@ -96,6 +96,7 @@ def test_invalid_request_error(self, session_mock): @mock.patch('requests.session', side_effect=mock.MagicMock) def test_authentication_error(self, session_mock): + mock.MagicMock.content = PropertyMock(return_value='{"error": {}}') mock.MagicMock.ok = PropertyMock(return_value=False) mock.MagicMock.status_code = PropertyMock(return_value=401) client = TestApiClient.mock_client()