Browse Source

skip converter tests if attic isn't installed

Antoine Beaupré 9 years ago
parent
commit
77ed6dec2b
1 changed files with 8 additions and 3 deletions
  1. 8 3
      borg/testsuite/convert.py

+ 8 - 3
borg/testsuite/convert.py

@@ -3,9 +3,14 @@ import pytest
 import shutil
 import shutil
 import tempfile
 import tempfile
 
 
-import attic.repository
-import attic.key
-import attic.helpers
+try:
+    import attic.repository
+    import attic.key
+    import attic.helpers
+except ImportError:
+    attic = None
+pytestmark = pytest.mark.skipif(attic is None,
+                                reason = 'cannot find an attic install')
 
 
 from ..converter import AtticRepositoryConverter, NotImplementedException
 from ..converter import AtticRepositoryConverter, NotImplementedException
 from ..helpers import get_keys_dir
 from ..helpers import get_keys_dir