assert 3 > 4
Assert that an exception is raised.
import pytest with pytest.raises(ZeroDivisionError): result = 10 / 0