From aad4104b088e6b6cfb639fde21de7a19b164ee4a Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 4 Mar 2022 12:08:42 -0700 Subject: [PATCH] Add skipif_teuthology_process 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 --- teuthology/test/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/teuthology/test/__init__.py b/teuthology/test/__init__.py index e69de29bb2..1eb9e81084 100644 --- a/teuthology/test/__init__.py +++ b/teuthology/test/__init__.py @@ -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 -- 2.39.5