diff --git a/fastapi/tests/test_fastapi.py b/fastapi/tests/test_fastapi.py index 37b11a96..cdec5b18 100644 --- a/fastapi/tests/test_fastapi.py +++ b/fastapi/tests/test_fastapi.py @@ -33,6 +33,7 @@ def _mocked_commit(self): with unittest.mock.patch.object( sql_db.TestCursor, "commit", return_value=None ) as mocked_commit: + mocked_commit.side_effect = Exception("Commit should not be called") yield mocked_commit def _assert_expected_lang(self, accept_language, expected_lang):