Conditionally skip tests related to audit log

This commit is contained in:
graham-dds
2019-10-18 11:27:02 -04:00
parent 1ac9243749
commit a1c672d89f
9 changed files with 34 additions and 0 deletions

View File

@@ -38,6 +38,19 @@ def app(request):
ctx.pop()
@pytest.fixture(autouse=True)
def skip_audit_log(request):
"""
Conditionally skip tests marked with 'audit_log' based on the
AUDIT_LOG_FEATURE_TOGGLE config value.
"""
config = make_config()
if request.node.get_closest_marker("audit_log"):
use_audit_log = config.get("AUDIT_LOG_FEATURE_TOGGLE", False)
if not use_audit_log:
pytest.skip("audit log feature flag disabled")
@pytest.fixture(scope="function")
def no_debug_app(request):
config = make_config(direct_config={"DEBUG": False})