Author: tomaz
Date: Sun Dec 30 07:11:02 2012
New Revision: 1426902
URL: http://svn.apache.org/viewvc?rev=1426902&view=rev
Log:
Better way of skipping local storage tests if lockfile is not available.
Modified:
libcloud/trunk/libcloud/test/storage/test_local.py
libcloud/trunk/setup.py
Modified: libcloud/trunk/libcloud/test/storage/test_local.py
URL:
http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/storage/test_local.py?rev=1426902&r1=1426901&r2=1426902&view=diff
==============================================================================
--- libcloud/trunk/libcloud/test/storage/test_local.py (original)
+++ libcloud/trunk/libcloud/test/storage/test_local.py Sun Dec 30 07:11:02 2012
@@ -30,7 +30,13 @@ from libcloud.storage.types import Conta
from libcloud.storage.types import InvalidContainerNameError
from libcloud.storage.types import ObjectDoesNotExistError
from libcloud.storage.types import ObjectHashMismatchError
-from libcloud.storage.drivers.local import LocalStorageDriver
+
+try:
+ from libcloud.storage.drivers.local import LocalStorageDriver
+except ImportError:
+ print('lockfile library is not available, skipping tests...')
+ LocalStorageDriver = None
+
from libcloud.storage.drivers.dummy import DummyIterator
@@ -310,5 +316,10 @@ class LocalTests(unittest.TestCase):
self.remove_tmp_file(tmppath)
+if not LocalStorageDriver:
+ class LocalTests(unittest.TestCase):
+ pass
+
+
if __name__ == '__main__':
sys.exit(unittest.main())
Modified: libcloud/trunk/setup.py
URL:
http://svn.apache.org/viewvc/libcloud/trunk/setup.py?rev=1426902&r1=1426901&r2=1426902&view=diff
==============================================================================
--- libcloud/trunk/setup.py (original)
+++ libcloud/trunk/setup.py Sun Dec 30 07:11:02 2012
@@ -130,13 +130,6 @@ class TestCommand(Command):
testfiles = []
for test_path in TEST_PATHS:
for t in glob(pjoin(self._dir, test_path, 'test_*.py')):
- if (sys.version_info >= (3, 2) and sys.version_info < (3, 3) or
- sys.version_info >= (2, 5) and sys.version_info < (2, 6)) \
- and t.find('test_local.py') >= 0:
- # Lockfile doesn't work with 2.5 and 3.2. Temporary disable
- # local_storage test until fixes have been submitted
- # upstream
- continue
testfiles.append('.'.join(
[test_path.replace('/', '.'), splitext(basename(t))[0]]))