diff --git a/project/tests/test_execute_sql.py b/project/tests/test_execute_sql.py index 7e9c5b20..e84fdd62 100644 --- a/project/tests/test_execute_sql.py +++ b/project/tests/test_execute_sql.py @@ -52,6 +52,9 @@ def setUpClass(cls): super().setUpClass() call_execute_sql(cls, None) + def tearDown(self): + DataCollector().stop_python_profiler() + def test_called(self): self.mock_sql._execute_sql.assert_called_once_with(*self.args, **self.kwargs) @@ -65,6 +68,9 @@ def setUpClass(cls): super().setUpClass() call_execute_sql(cls, Request()) + def tearDown(self): + DataCollector().stop_python_profiler() + def test_called(self): self.mock_sql._execute_sql.assert_called_once_with(*self.args, **self.kwargs) @@ -77,6 +83,9 @@ def test_query(self): class TestCallSilky(TestCase): + def tearDown(self): + DataCollector().stop_python_profiler() + def test_no_effect(self): DataCollector().configure() sql, _ = mock_sql() @@ -89,6 +98,9 @@ def test_no_effect(self): class TestCollectorInteraction(TestCase): + def tearDown(self): + DataCollector().stop_python_profiler() + def _query(self): try: query = list(DataCollector().queries.values())[0]