]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
openstack: tests: look in caplog 672/head
authorLoic Dachary <ldachary@redhat.com>
Mon, 26 Oct 2015 23:10:59 +0000 (08:10 +0900)
committerLoic Dachary <ldachary@redhat.com>
Tue, 27 Oct 2015 01:58:50 +0000 (10:58 +0900)
The output is now logged, use caplog instead of capsys and add it as a
test dependency.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
teuthology/openstack/test/test_openstack.py
tox.ini

index 33d1679a0a5317cc1b2710e18e3f17aa0d874077..ac68d145381aaf242bca33190cd22765dcd7094e 100644 (file)
@@ -131,7 +131,7 @@ openstack keypair delete {key_name} || true
         """.format(key_name=self.key_name,
                    name=self.name))
 
-    def test_create(self, capsys):
+    def test_create(self, caplog):
         teuthology_argv = [
             '--suite', 'upgrade/hammer',
             '--dry-run',
@@ -168,8 +168,7 @@ openstack keypair delete {key_name} || true
         assert "clone=git clone" in variables
         assert os.environ['OS_AUTH_URL'] in variables
 
-        out, err = capsys.readouterr()
-        assert " ".join(teuthology_argv) in out
+        assert " ".join(teuthology_argv) in caplog.text()
 
         if self.can_create_floating_ips:
             ip = teuthology.get_floating_ip(self.name)
diff --git a/tox.ini b/tox.ini
index 0d1d89ccf4cc551a960f7a23e6c97f8296ed0b68..4715a7ad0cc26e548e132b58590d2f62b46436e7 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -53,6 +53,7 @@ sitepackages=True
 deps=
   -r{toxinidir}/requirements.txt
   mock
+  pytest-capturelog
 
 commands=py.test -v {posargs:teuthology/openstack/test/test_openstack.py}
 basepython=python2.7