]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix undef function call in test_migrations for py26
authorMike Perez <thingee@gmail.com>
Mon, 18 Feb 2013 19:17:26 +0000 (11:17 -0800)
committerMike Perez <thingee@gmail.com>
Mon, 18 Feb 2013 19:34:55 +0000 (11:34 -0800)
unittest does not have this function until later. This uses the already
imported cinder.test.skip_unless to accomplish the same result without
outputted error.

Change-Id: Id20add5a0d41e5d8cf6f8bc6aa0e547e5e386dab

cinder/tests/test_migrations.py

index 5ba715e310e2a64d249ba0760af037437d8e2220..936bd7ac9795b59a61d69f21b1a6dfc03f8ead94 100644 (file)
@@ -276,10 +276,9 @@ class TestMigrations(test.TestCase):
         if _is_backend_avail('postgres', user="openstack_cifail"):
             self.fail("Shouldn't have connected")
 
+    @test.skip_unless(_is_backend_avail('postgres'),
+                      "postgresql not available")
     def test_postgresql_opportunistically(self):
-        # Test postgresql database migration walk
-        if not _is_backend_avail('postgres'):
-            self.skipTest("postgresql not available")
         # add this to the global lists to make reset work with it, it's removed
         # automatically in tearDown so no need to clean it up here.
         connect_string = _get_connect_string("postgres")