Kaynağa Gözat

close fh of importer test

oz123 10 yıl önce
ebeveyn
işleme
851add68b1
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. 5 1
      pwman/tests/test_importer.py

+ 5 - 1
pwman/tests/test_importer.py

@@ -53,7 +53,8 @@ class TestImporter(unittest.TestCase):
         config = {}
         db = SQLite('test-importer.db')
         Args = namedtuple('args', 'import_file')
-        self.importer = CSVImporter(Args(import_file=open('import_file.csv')),
+        args = Args(import_file=open('import_file.csv'))
+        self.importer = CSVImporter(args,
                                     config, db)
 
     def test_read_file(self):
@@ -99,6 +100,9 @@ class TestImporter(unittest.TestCase):
         importer.importer.run(callback=DummyCallback)
         args.import_file.close()
 
+    def tearDown(self):
+        self.importer.args.import_file.close()
+
 
 if __name__ == '__main__':