Selaa lähdekoodia

Fix for windows python 3.5

Oz N Tiram 8 vuotta sitten
vanhempi
commit
414ac1e51a
2 muutettua tiedostoa jossa 8 lisäystä ja 6 poistoa
  1. 0 1
      tests/test_base_ui.py
  2. 8 5
      tests/test_tools.py

+ 0 - 1
tests/test_base_ui.py

@@ -132,7 +132,6 @@ class TestBaseUI(unittest.TestCase):
         for t in ['foo', 'bar', 'baz']:
             t in v
         sys.stdout = sys.__stdout__
-        print(v)
 
     def test_7_get_ids(self):
         # used by do_cp or do_open,

+ 8 - 5
tests/test_tools.py

@@ -113,11 +113,14 @@ class SetupTester(object):
     def clean(self):
         dbfile = self.configp.get_value('Database', 'filename')
         dburi = urlparse(self.configp.get_value('Database', 'dburi')).path
-        if os.path.exists(dbfile):
-            os.remove(dbfile)
-
-        if os.path.exists(dburi):
-            os.remove(dburi)
+        try:
+            if os.path.exists(dbfile):
+                os.remove(dbfile)
+
+            if os.path.exists(dburi):
+                os.remove(dburi)
+        except PermissionError:
+            pass
 
         if os.path.exists(os.path.join(os.path.dirname(__file__),
                                        'testing_config')):