PyTest expected exceptions (no exception) output
def test_zero_division():
with pytest.raises(ValueError) as e:
> divide(1, 0)
E Failed: DID NOT RAISE <class 'ValueError'>
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
def test_zero_division():
with pytest.raises(ValueError) as e:
> divide(1, 0)
E Failed: DID NOT RAISE <class 'ValueError'>