]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/pybind: explicitly remove references in tearDown
authorHector Martin <marcan@marcan.st>
Fri, 26 Feb 2016 10:12:40 +0000 (19:12 +0900)
committerHector Martin <marcan@marcan.st>
Tue, 24 May 2016 11:30:46 +0000 (20:30 +0900)
Looks like nose likes to leave references to the test instances around.
This doesn't break anything, but does cause Ioctx/Image objects to stick
around which makes debugging more complicated, as everything gets dealloced
together at the end.

Signed-off-by: Hector Martin <marcan@marcan.st>
src/test/pybind/test_rados.py
src/test/pybind/test_rbd.py

index 03cf2dd7a14dc7b09f3cde4783bf9ba0a07ed2ce..d9b40c1f6c937394c5290307cb81d1919ee980e4 100644 (file)
@@ -748,8 +748,10 @@ class TestObject(object):
 
     def tearDown(self):
         self.ioctx.close()
+        self.ioctx = None
         self.rados.delete_pool('test_pool')
         self.rados.shutdown()
+        self.rados = None
 
     def test_read(self):
         eq(self.object.read(3), b'bar')
index b60f09fba62f7ea722ab83ce0f7d91966228fdab..259221dc4ef1b68a64bc36180ed02edf874c87e3 100644 (file)
@@ -289,6 +289,7 @@ class TestImage(object):
     def tearDown(self):
         self.image.close()
         remove_image()
+        self.image = None
 
     @require_new_format()
     @blacklist_features([RBD_FEATURE_EXCLUSIVE_LOCK])