menu_book Course Curriculum (Software Testing) expand_more
Testing Fundamentals
Assertions & Fixtures
Test Doubles & Dependencies
Coverage & Quality
API & Web Testing
exception assertion
Learn exception assertion in Software Testing with a dedicated explanation, a concept-specific example, practical cautions, and a mastery check.
12 min read
•
Beginner
Advertisement
software-testing-010.py
python
import pytest
def divide(a,b): return a/b
def test_zero_division():
with pytest.raises(ZeroDivisionError): divide(5,0)
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content