mirror of
https://github.com/zama-ai/concrete.git
synced 2026-04-17 03:00:54 -04:00
committed by
Benoit Chevallier
parent
585de78081
commit
e78086eefa
29
tests/common/debugging/test_custom_assert.py
Normal file
29
tests/common/debugging/test_custom_assert.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""Test custom assert functions."""
|
||||
import pytest
|
||||
|
||||
from concrete.common.debugging.custom_assert import (
|
||||
assert_false,
|
||||
assert_not_reached,
|
||||
assert_true,
|
||||
)
|
||||
|
||||
|
||||
def test_assert_not_functions():
|
||||
"""Test custom assert functions"""
|
||||
assert_true(True, "one check")
|
||||
assert_false(False, "another check")
|
||||
|
||||
with pytest.raises(AssertionError) as excinfo:
|
||||
assert_not_reached("yet another one")
|
||||
|
||||
assert "yet another one" in str(excinfo.value)
|
||||
|
||||
with pytest.raises(AssertionError) as excinfo:
|
||||
assert_true(False, "one failing check")
|
||||
|
||||
assert "one failing check" in str(excinfo.value)
|
||||
|
||||
with pytest.raises(AssertionError) as excinfo:
|
||||
assert_false(True, "another failing check")
|
||||
|
||||
assert "another failing check" in str(excinfo.value)
|
||||
Reference in New Issue
Block a user