From 46f83b800ceb31696ebe69246c9cb5c2b243f866 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 5 Dec 2019 15:49:43 +0100 Subject: [PATCH 132/181] tests: Ensure objects are free'ed at the end of tests The objects may not be garbage collected otherwise. --- tests/capture.py | 4 ++++ tests/synaptics/custom.py | 4 ++++ tests/virtual-image.py | 2 ++ 3 files changed, 10 insertions(+) diff --git a/tests/capture.py b/tests/capture.py index a7b7583..88ed81f 100755 --- a/tests/capture.py +++ b/tests/capture.py @@ -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() diff --git a/tests/synaptics/custom.py b/tests/synaptics/custom.py index 6016799..b0f1c54 100755 --- a/tests/synaptics/custom.py +++ b/tests/synaptics/custom.py @@ -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 diff --git a/tests/virtual-image.py b/tests/virtual-image.py index 87c221b..11ec8ae 100755 --- a/tests/virtual-image.py +++ b/tests/virtual-image.py @@ -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() -- 2.24.1