Skip to content

Commit

Permalink
adding test
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Oct 17, 2024
1 parent 5f5dd22 commit 17b9dfd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,3 +490,15 @@ def fn_minus(a, b=2):

assert count_p == 1
assert count_m == 1


@pytest.mark.parametrize("backend", ["memory", "pickle"])
def test_raise_exception(tmpdir, backend: str):
@cachier.cachier(cache_dir=tmpdir, backend=backend, allow_none=True)
def tmp_test(_):
raise RuntimeError("always raise")

with pytest.raises(RuntimeError):
tmp_test(123)
with pytest.raises(RuntimeError):
tmp_test(123)

0 comments on commit 17b9dfd

Please sign in to comment.