Blame SOURCES/0132-tests-Ensure-objects-are-free-ed-at-the-end-of-tests.patch

73b847
From 46f83b800ceb31696ebe69246c9cb5c2b243f866 Mon Sep 17 00:00:00 2001
73b847
From: Benjamin Berg <bberg@redhat.com>
73b847
Date: Thu, 5 Dec 2019 15:49:43 +0100
73b847
Subject: [PATCH 132/181] tests: Ensure objects are free'ed at the end of tests
73b847
73b847
The objects may not be garbage collected otherwise.
73b847
---
73b847
 tests/capture.py          | 4 ++++
73b847
 tests/synaptics/custom.py | 4 ++++
73b847
 tests/virtual-image.py    | 2 ++
73b847
 3 files changed, 10 insertions(+)
73b847
73b847
diff --git a/tests/capture.py b/tests/capture.py
73b847
index a7b7583..88ed81f 100755
73b847
--- a/tests/capture.py
73b847
+++ b/tests/capture.py
73b847
@@ -17,6 +17,7 @@ c.enumerate()
73b847
 devices = c.get_devices()
73b847
 
73b847
 d = devices[0]
73b847
+del devices
73b847
 
73b847
 d.open_sync()
73b847
 
73b847
@@ -24,6 +25,9 @@ img = d.capture_sync(True)
73b847
 
73b847
 d.close_sync()
73b847
 
73b847
+del d
73b847
+del c
73b847
+
73b847
 width = img.get_width()
73b847
 height = img.get_height()
73b847
 
73b847
diff --git a/tests/synaptics/custom.py b/tests/synaptics/custom.py
73b847
index 6016799..b0f1c54 100755
73b847
--- a/tests/synaptics/custom.py
73b847
+++ b/tests/synaptics/custom.py
73b847
@@ -11,6 +11,7 @@ c.enumerate()
73b847
 devices = c.get_devices()
73b847
 
73b847
 d = devices[0]
73b847
+del devices
73b847
 
73b847
 assert d.get_driver() == "synaptics"
73b847
 
73b847
@@ -40,3 +41,6 @@ print("deleting")
73b847
 d.delete_print_sync(p)
73b847
 print("delete done")
73b847
 d.close_sync()
73b847
+
73b847
+del d
73b847
+del c
73b847
diff --git a/tests/virtual-image.py b/tests/virtual-image.py
73b847
index 87c221b..11ec8ae 100755
73b847
--- a/tests/virtual-image.py
73b847
+++ b/tests/virtual-image.py
73b847
@@ -83,6 +83,8 @@ class VirtualImage(unittest.TestCase):
73b847
     @classmethod
73b847
     def tearDownClass(cls):
73b847
         shutil.rmtree(cls.tmpdir)
73b847
+        del cls.dev
73b847
+        del cls.ctx
73b847
 
73b847
     def setUp(self):
73b847
         self.dev.open_sync()
73b847
-- 
73b847
2.24.1
73b847