diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-12-31 10:01:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-31 10:01:31 +0100 |
| commit | d88ec42bd0a37340c8477a6f20bf26e58bd84735 (patch) | |
| tree | abd9422f7fb34a19579a74515ce84d9f472cd226 /tests/delete_regress | |
| parent | 81ccf92f154c6d9eac3e30bac0aa67574d0ace15 (diff) | |
Used addCleanup() in tests where appropriate.
Diffstat (limited to 'tests/delete_regress')
| -rw-r--r-- | tests/delete_regress/tests.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/delete_regress/tests.py b/tests/delete_regress/tests.py index 71e3bcb405..89f4d5ddd8 100644 --- a/tests/delete_regress/tests.py +++ b/tests/delete_regress/tests.py @@ -51,11 +51,9 @@ class DeleteLockingTest(TransactionTestCase): # Create a second connection to the default database self.conn2 = connection.copy() self.conn2.set_autocommit(False) - - def tearDown(self): # Close down the second connection. - self.conn2.rollback() - self.conn2.close() + self.addCleanup(self.conn2.close) + self.addCleanup(self.conn2.rollback) def test_concurrent_delete(self): """Concurrent deletes don't collide and lock the database (#9479).""" |
