ah ha! not using "with" was not calling the "close" function
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 24 Jul 2020 11:06:08 +0000 (12:06 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 24 Jul 2020 11:06:08 +0000 (12:06 +0100)
src/soc/fu/div/test/test_pipe_caller.py

index 6753f8ad6bb6471533cd62dc005d4a9d13cece31..a5e83887afbfcdf16359339114ed3f2020e59437 100644 (file)
@@ -208,8 +208,9 @@ class DivTestCases:
                     initial_regs = [0] * 32
                     initial_regs[1] = ra
                     initial_regs[2] = rb
-                    prog = Program(l, bigendian)
-                    self.run_test_program(prog, initial_regs)
+                    # use "with" so as to close the files used
+                    with Program(l, bigendian) as prog:
+                        self.run_test_program(prog, initial_regs)
 
     def tst_rand_divwu(self):
         insns = ["divwu", "divwu.", "divwuo", "divwuo."]