Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pytest check exception

# Check that my_statement(myarg) raises ValueError
import pytest

def test_testname():
    with pytest.raises(ValueError):
        my_statement(myarg)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pytest #check #exception
ADD COMMENT
Topic
Name
8+8 =