From 2d7da5e1403e4713085b08d109b932490f0b5d63 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 22 Mar 2020 15:24:53 +0300 Subject: [PATCH] Explicitly close file descriptors to satisfy hypothesis checks --- tests/test_cms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_cms.py b/tests/test_cms.py index 51bdaf1..9ce038b 100644 --- a/tests/test_cms.py +++ b/tests/test_cms.py @@ -294,6 +294,7 @@ class TestSignedDataCERWithOpenSSL(TestCase): buf = BytesIO() agg_octet_string(evgens, ("encapContentInfo", "eContent"), raw, buf.write) self.assertSequenceEqual(buf.getvalue(), data) + fd.close() def create_huge_file(self): rnd = urandom(1<<20) @@ -382,6 +383,7 @@ class TestSignedDataCERWithOpenSSL(TestCase): ci.encode_cer(fd.write) print("CMS written", time() - start) self.verify(cert_path, cms_path) + eci_fd.close() @skipIf(PY2, "no mmaped memoryview support in PY2") @skipIf("PYDERASN_TEST_CMS_HUGE" not in environ, "PYDERASN_TEST_CMS_HUGE is not set") -- 2.44.0