import pytest def test_expected_exception(): with pytest.raises(ZeroDivisionError): assert 1 / 0
Best Python code snippet using assertpy_python
Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.
Execute automation tests with assertpy on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.Test now for Free