Commit 561a5c13 authored by Jim Fulton's avatar Jim Fulton

Added missing resource-release code.

parent 2c6e83c3
...@@ -988,6 +988,7 @@ transaction, we'll get a result: ...@@ -988,6 +988,7 @@ transaction, we'll get a result:
>>> sorted([int(u64(oid)) for (oid, _) in oids]) >>> sorted([int(u64(oid)) for (oid, _) in oids])
[0, 101, 102, 103, 104] [0, 101, 102, 103, 104]
>>> fs.close()
""" """
def tpc_finish_error(): def tpc_finish_error():
......
...@@ -273,6 +273,7 @@ share the same class: ...@@ -273,6 +273,7 @@ share the same class:
>>> file = connection.exportFile(p._p_oid) >>> file = connection.exportFile(p._p_oid)
>>> file.seek(0) >>> file.seek(0)
>>> cp = connection.importFile(file) >>> cp = connection.importFile(file)
>>> file.close()
>>> cp.color >>> cp.color
'blue' 'blue'
...@@ -282,6 +283,7 @@ share the same class: ...@@ -282,6 +283,7 @@ share the same class:
>>> cp.__class__ is p.__class__ >>> cp.__class__ is p.__class__
True True
>>> tm.abort()
XXX test abort of import XXX test abort of import
...@@ -57,6 +57,7 @@ Now, after closing all readers and writers we can consume files again:: ...@@ -57,6 +57,7 @@ Now, after closing all readers and writers we can consume files again::
>>> blob_read.read() >>> blob_read.read()
'I am another blob.' 'I am another blob.'
>>> blob_read.close()
Edge cases Edge cases
========== ==========
......
...@@ -21,6 +21,8 @@ The created file is in the default temporary directory:: ...@@ -21,6 +21,8 @@ The created file is in the default temporary directory::
>>> w.name.startswith(tempfile.gettempdir()) >>> w.name.startswith(tempfile.gettempdir())
True True
>>> w.close()
Case 2: Blobs that are in a database Case 2: Blobs that are in a database
==================================== ====================================
...@@ -45,3 +47,5 @@ writing and expect the file to be in the blob temporary directory:: ...@@ -45,3 +47,5 @@ writing and expect the file to be in the blob temporary directory::
>>> w = blob.open('w') >>> w = blob.open('w')
>>> w.name.startswith(os.path.join(blob_dir, 'tmp')) >>> w.name.startswith(os.path.join(blob_dir, 'tmp'))
True True
>>> w.close()
...@@ -485,11 +485,12 @@ there are: ...@@ -485,11 +485,12 @@ there are:
Of course, calling lastInvalidations on an empty storage refturns no data: Of course, calling lastInvalidations on an empty storage refturns no data:
>>> fs.close() >>> db.close()
>>> fs = ZODB.FileStorage.FileStorage('t.fs', create=True) >>> fs = ZODB.FileStorage.FileStorage('t.fs', create=True)
>>> list(fs.lastInvalidations(10)) >>> list(fs.lastInvalidations(10))
[] []
>>> fs.close()
""" """
def deal_with_finish_failures(): def deal_with_finish_failures():
......
...@@ -527,6 +527,7 @@ def loadblob_tmpstore(): ...@@ -527,6 +527,7 @@ def loadblob_tmpstore():
Clean up: Clean up:
>>> tmpstore.close()
>>> database.close() >>> database.close()
""" """
......
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