Explorar el Código

tests: fix file descriptor leak

Marek Marczykowski-Górecki hace 7 años
padre
commit
9cdf9a0e60
Se han modificado 2 ficheros con 1 adiciones y 1 borrados
  1. 0 1
      qubesadmin/tests/app.py
  2. 1 0
      qubesadmin/tests/storage.py

+ 0 - 1
qubesadmin/tests/app.py

@@ -323,7 +323,6 @@ class TC_20_QubesLocal(unittest.TestCase):
         with open(tmpdir + '/payload') as payload:
             self.assertEqual(payload.read(), 'some payload\n')
 
-
     def test_010_run_service(self):
         self.listen_and_send(b'0\0')
         with mock.patch('subprocess.Popen') as mock_proc:

+ 1 - 0
qubesadmin/tests/storage.py

@@ -158,6 +158,7 @@ class TestVMVolume(qubesadmin.tests.QubesTestCase):
         input_proc = subprocess.Popen(['echo', '-n', 'some-data'],
             stdout=subprocess.PIPE)
         self.vol.import_data(input_proc.stdout)
+        input_proc.stdout.close()
         self.assertAllCalled()