Sfoglia il codice sorgente

Mooaarr windows fixes

Oz N Tiram 8 anni fa
parent
commit
947f1d6194
1 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. 5 2
      tests/test_init.py

+ 5 - 2
tests/test_init.py

@@ -65,7 +65,7 @@ class TestInit(unittest.TestCase):
         for item in ('dummy.cfg', testdb):
             try:
                 os.unlink(item)
-            except OSError:
+            except (OSError, PermissionError):
                 continue
 
     def setUp(self):
@@ -78,7 +78,10 @@ class TestInit(unittest.TestCase):
 
     def tearDown(self):
         del(self.tester)
-        os.unlink(self.db._filename)
+        try:
+            os.unlink(self.db._filename)
+        except PermissionError:
+            pass
 
     def test_get_db_version(self):
         v = get_db_version(self.tester.configp, 'sqlite')