mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Used addCleanup() in tests where appropriate.
This commit is contained in:
parent
81ccf92f15
commit
d88ec42bd0
37 changed files with 121 additions and 240 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue