From: Markus Blatt <markus@dr-blatt.de>
Date: Fri, 13 Jan 2023 17:06:43 +0100
Subject: [python] Prevent "ResourceWarning: unclosed file <_io.TextIOWrapper

---
 python/tests/test_time_vector.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/python/tests/test_time_vector.py b/python/tests/test_time_vector.py
index 4f27413..6c81782 100644
--- a/python/tests/test_time_vector.py
+++ b/python/tests/test_time_vector.py
@@ -83,7 +83,8 @@ class TestTimeVector(unittest.TestCase):
                                     datetime.datetime(1998,  8,  1)])
 
     def test_str(self):
-        tv = TimeVector(datetime.date(1997, 11, 6), base_string = open(test_path("data/schedule/part1.sch")).read())
+        with open(test_path("data/schedule/part1.sch")) as f:
+            tv = TimeVector(datetime.date(1997, 11, 6), base_string = f.read())
         tv.load(test_path("data/schedule/part3.sch"))
         tv.load(test_path("data/schedule/part2.sch"))
 
