summaryrefslogtreecommitdiff
path: root/tests/gis_tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-12-31 10:01:31 +0100
committerGitHub <noreply@github.com>2023-12-31 10:01:31 +0100
commitd88ec42bd0a37340c8477a6f20bf26e58bd84735 (patch)
treeabd9422f7fb34a19579a74515ce84d9f472cd226 /tests/gis_tests
parent81ccf92f154c6d9eac3e30bac0aa67574d0ace15 (diff)
Used addCleanup() in tests where appropriate.
Diffstat (limited to 'tests/gis_tests')
-rw-r--r--tests/gis_tests/utils.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/gis_tests/utils.py b/tests/gis_tests/utils.py
index 2fbfd438eb..2431ba4cec 100644
--- a/tests/gis_tests/utils.py
+++ b/tests/gis_tests/utils.py
@@ -64,12 +64,7 @@ class FuncTestMixin:
vendor_impl = "as_" + connection.vendor
__getattribute__original = Func.__getattribute__
- self.func_patcher = mock.patch.object(
- Func, "__getattribute__", __getattribute__
- )
- self.func_patcher.start()
+ func_patcher = mock.patch.object(Func, "__getattribute__", __getattribute__)
+ func_patcher.start()
+ self.addCleanup(func_patcher.stop)
super().setUp()
-
- def tearDown(self):
- super().tearDown()
- self.func_patcher.stop()