Skip to content

Commit

Permalink
Fix error in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed Aug 1, 2023
1 parent 0fb5836 commit e83da86
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_integration/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ def test_examples_api(dirname):
if not CACHE_AVAILABLE:
expected_to_raise_exc = True

with (
pytest.raises(Abort)
if expected_to_raise_exc else contextlib.nullcontext(),
):
if expected_to_raise_exc:
cm = pytest.raises(Abort)
else:
cm = contextlib.nullcontext()
with cm:
cfg = config.load_config(config_file=config_file)
build(cfg, dirty=False)

0 comments on commit e83da86

Please sign in to comment.