Commit 01b995a4 authored by Kirill Smelkov's avatar Kirill Smelkov

tests: Explicitly close ZODB connections for places with warnings found by previous patch

bigfile/tests/test_filezodb.py ........W: testdb: teardown: <Connection at 7f8fe2b43b90> left not closed by test code; opened by:
  ...
  File "/home/kirr/src/wendelin/wendelin.core/bigfile/tests/test_filezodb.py", line 754, in test_bigfile_zblk1_zdata_reuse
    _test_bigfile_zblk1_zdata_reuse()
  File "/home/kirr/src/wendelin/wendelin.core/bigfile/tests/test_filezodb.py", line 759, in _test_bigfile_zblk1_zdata_reuse
    root = dbopen()
  File "/home/kirr/src/wendelin/wendelin.core/bigfile/tests/test_filezodb.py", line 47, in dbopen
    return testdb.dbopen()
  File "/home/kirr/src/wendelin/wendelin.core/lib/testing.py", line 188, in dbopen
    self.connv.append( (weakref.ref(conn), ''.join(traceback.format_stack())) )

lib/tests/test_zodb.py .W: testdb: teardown: <Connection at 7f8fe26f13d0> left not closed by test code; opened by:
  ...
  File "/home/kirr/src/wendelin/wendelin.core/lib/tests/test_zodb.py", line 49, in test_deactivate_btree
    root = dbopen()
  File "/home/kirr/src/wendelin/wendelin.core/lib/tests/test_zodb.py", line 30, in dbopen
    return testdb.dbopen()
  File "/home/kirr/src/wendelin/wendelin.core/lib/testing.py", line 188, in dbopen
    self.connv.append( (weakref.ref(conn), ''.join(traceback.format_stack())) )
parent 5a5ed2c7
...@@ -790,3 +790,5 @@ def _test_bigfile_zblk1_zdata_reuse(): ...@@ -790,3 +790,5 @@ def _test_bigfile_zblk1_zdata_reuse():
assert len(zdata_v1) == len(zdata_v2) assert len(zdata_v1) == len(zdata_v2)
for i in range(len(zdata_v1)): for i in range(len(zdata_v1)):
assert zdata_v1[i] is zdata_v2[i] assert zdata_v1[i] is zdata_v2[i]
dbclose(root)
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
# #
# See COPYING file for full licensing terms. # See COPYING file for full licensing terms.
# See https://www.nexedi.com/licensing for rationale and options. # See https://www.nexedi.com/licensing for rationale and options.
from wendelin.lib.zodb import deactivate_btree from wendelin.lib.zodb import deactivate_btree, dbclose
from wendelin.lib.testing import getTestDB from wendelin.lib.testing import getTestDB
from persistent import Persistent, UPTODATE, GHOST from persistent import Persistent, UPTODATE, GHOST
from BTrees.IOBTree import IOBTree from BTrees.IOBTree import IOBTree
...@@ -81,3 +81,5 @@ def test_deactivate_btree(): ...@@ -81,3 +81,5 @@ def test_deactivate_btree():
for obj in [B] + leafv: for obj in [B] + leafv:
assert obj._p_state == GHOST assert obj._p_state == GHOST
assert obj not in cached assert obj not in cached
dbclose(root)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment