aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasil Velichkov <vvvelichkov@gmail.com>2019-09-10 01:23:30 +0300
committerPiotr Krysik <ptrkrysik@gmail.com>2020-02-14 15:14:59 +0000
commita15f4ab4fecb3dc94d6419ef23e274e4c099e551 (patch)
tree3633e6c48b6bf96e8cd648a6a974955d35fda1b2
parenteadf477a6a70dc448c10a96960b333fce077813c (diff)
tests: Close the temp file handle in qa_burst_file_source
This fixes the following warning ./usr/lib64/python3.7/unittest/case.py:645: ResourceWarning: unclosed file <_io.BufferedWriter name='/tmp/tmpkkz_akd6'> testMethod() ResourceWarning: Enable tracemalloc to get the object allocation traceback Change-Id: I66c2be2e5bf6915e3df253b3a69f5516534e3750
-rw-r--r--python/qa_burst_file_source.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/python/qa_burst_file_source.py b/python/qa_burst_file_source.py
index c83c9c4..bfdcc73 100644
--- a/python/qa_burst_file_source.py
+++ b/python/qa_burst_file_source.py
@@ -51,6 +51,7 @@ class qa_burst_file_sink (gr_unittest.TestCase):
0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01
]))
handle.flush();
+ handle.close();
src = grgsm.burst_file_source(temp.name);
dst = grgsm.burst_sink();
@@ -88,6 +89,7 @@ class qa_burst_file_sink (gr_unittest.TestCase):
0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01
]))
handle.flush();
+ handle.close();
src = grgsm.burst_file_source(temp.name);
dst = grgsm.burst_sink();