]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add skipif_teuthology_process
authorZack Cerza <zack@redhat.com>
Fri, 4 Mar 2022 19:08:42 +0000 (12:08 -0700)
committerZack Cerza <zack@redhat.com>
Wed, 16 Mar 2022 22:51:16 +0000 (16:51 -0600)
There are a couple unit tests that seem to be fundamentally unable to
be used properly if they are run as part of a teuthology process, as
opposed to directly inside py.test. This fixture makes it easy to skip
those tests in such an environment without skipping them elsewhere.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/test/__init__.py

index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..1eb9e810847c9b6aa0daf9bf42decf792ae3ee37 100644 (file)
@@ -0,0 +1,9 @@
+import os
+import pytest
+import sys
+
+skipif_teuthology_process = pytest.mark.skipif(
+    os.path.basename(sys.argv[0]) == "teuthology",
+    reason="Skipped because this test cannot pass when run in a teuthology " \
+        "process (as opposed to py.test)"
+)
\ No newline at end of file