tests: Ensure objects are free'ed at the end of tests
The objects may not be garbage collected otherwise.
This commit is contained in:
parent
4948a85e97
commit
1d1c39c234
3 changed files with 10 additions and 0 deletions
|
@ -17,6 +17,7 @@ c.enumerate()
|
|||
devices = c.get_devices()
|
||||
|
||||
d = devices[0]
|
||||
del devices
|
||||
|
||||
d.open_sync()
|
||||
|
||||
|
@ -24,6 +25,9 @@ img = d.capture_sync(True)
|
|||
|
||||
d.close_sync()
|
||||
|
||||
del d
|
||||
del c
|
||||
|
||||
width = img.get_width()
|
||||
height = img.get_height()
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ c.enumerate()
|
|||
devices = c.get_devices()
|
||||
|
||||
d = devices[0]
|
||||
del devices
|
||||
|
||||
assert d.get_driver() == "synaptics"
|
||||
|
||||
|
@ -40,3 +41,6 @@ print("deleting")
|
|||
d.delete_print_sync(p)
|
||||
print("delete done")
|
||||
d.close_sync()
|
||||
|
||||
del d
|
||||
del c
|
||||
|
|
|
@ -83,6 +83,8 @@ class VirtualImage(unittest.TestCase):
|
|||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
shutil.rmtree(cls.tmpdir)
|
||||
del cls.dev
|
||||
del cls.ctx
|
||||
|
||||
def setUp(self):
|
||||
self.dev.open_sync()
|
||||
|
|
Loading…
Reference in a new issue