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 460d8d2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/test_integration/test_examples.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import contextlib
import os
import subprocess
import sys
Expand Down Expand Up @@ -49,9 +48,12 @@ 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(),
):
def run():
cfg = config.load_config(config_file=config_file)
build(cfg, dirty=False)

if expected_to_raise_exc:
with pytest.raises(Abort):
run()
else:
run()

0 comments on commit 460d8d2

Please sign in to comment.