diff --git a/CHANGES.rst b/CHANGES.rst index 92a72bca63..8dd2a884df 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,9 +1,10 @@ 1.2.1 (unreleased) ================== +general +------- - - +- Make CRDS context reporting pytest plugin disabled by default. [#6070] 1.2.0 (2021-05-24) ================== diff --git a/pytest_crds/plugin.py b/pytest_crds/plugin.py index ca77d40c7e..c582300362 100644 --- a/pytest_crds/plugin.py +++ b/pytest_crds/plugin.py @@ -1,6 +1,13 @@ -from stpipe.crds_client import get_context_used +def pytest_addoption(parser): + parser.addoption("--report-crds-context", action="store_true", + help="Report CRDS context in test suite header") def pytest_report_header(config): """Add CRDS_CONTEXT to pytest report header""" - return f"crds_context: {get_context_used('jwst')}" + + if config.getoption("report_crds_context"): + from stpipe.crds_client import get_context_used + return f"crds_context: {get_context_used('jwst')}" + else: + return [] diff --git a/setup.cfg b/setup.cfg index 97a9d76a4e..fc49ca894e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -129,7 +129,7 @@ junit_family = xunit2 inputs_root = jwst-pipeline results_root = jwst-pipeline-results text_file_format = rst -addopts = --show-capture=no --open-files +addopts = --show-capture=no --open-files --report-crds-context filterwarnings = ignore:Models in math_functions:astropy.utils.exceptions.AstropyUserWarning