Skip to content

Commit

Permalink
update regtest conftest for pytest 8 (#8245)
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram authored Jan 30, 2024
1 parent 5dfb515 commit 557c3fa
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions jwst/regtest/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,22 @@
@pytest.fixture(scope="session")
def artifactory_repos(pytestconfig):
"""Provides Artifactory inputs_root and results_root"""
try:
inputs_root = pytestconfig.getini('inputs_root')[0]
results_root = pytestconfig.getini('results_root')[0]
except IndexError:
inputs_root = pytestconfig.getini('inputs_root')
# in pytest 8 inputs_root will be None
# in pytest <8 inputs_root will be []
# see: https://github.com/pytest-dev/pytest/pull/11594
# using "not inputs_root" will handle both cases
if not inputs_root:
inputs_root = "jwst-pipeline"
else:
inputs_root = inputs_root[0]

results_root = pytestconfig.getini('results_root')
# see not above about inputs_root
if not results_root:
results_root = "jwst-pipeline-results"
else:
results_root = results_root[0]
return inputs_root, results_root


Expand Down

0 comments on commit 557c3fa

Please sign in to comment.