From: Paul Vinciguerra Date: Thu, 17 Dec 2020 02:03:16 +0000 (-0500) Subject: tests: explicitly close subprocess files X-Git-Tag: v21.10-rc0~539 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F53%2F30453%2F3;p=vpp.git tests: explicitly close subprocess files Resolve the following error: /vpp/test/framework.py:657: ResourceWarning: unclosed file <_io.BufferedReader name=6> del cls.vpp Object allocated at (most recent call last): File "/usr/lib/python3.8/subprocess.py", lineno 844 self.stdout = io.open(c2pread, 'rb', bufsize) Type: test Change-Id: Ia2974da594f0582dcff1f4bdf40d25475769c46c Signed-off-by: Paul Vinciguerra --- diff --git a/test/framework.py b/test/framework.py index c9ecafd2bca..9bb3e01c31e 100644 --- a/test/framework.py +++ b/test/framework.py @@ -679,6 +679,8 @@ class VppTestCase(unittest.TestCase): cls.vpp.communicate() cls.logger.debug("Deleting class vpp attribute on %s", cls.__name__) + cls.vpp.stdout.close() + cls.vpp.stderr.close() del cls.vpp if cls.vpp_startup_failed: