Skip to content

Commit 62a47d1

Browse files
author
Joan Massich
committed
Add test from #1830
1 parent b1fbb2a commit 62a47d1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

testing/python/raises.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ def test_no_raise_message(self):
8787
else:
8888
assert False, "Expected pytest.raises.Exception"
8989

90+
@pytest.mark.parametrize('example_input,expectation', [
91+
(3, do_not_raise),
92+
(2, do_not_raise),
93+
(1, do_not_raise),
94+
(0, raises(ZeroDivisionError))])
95+
def test_do_not_raise(example_input, expectation):
96+
"""Test do_not_raise."""
97+
with expectation:
98+
assert (6 / example_input) is not None
99+
90100
def test_custom_raise_message(self):
91101
message = "TEST_MESSAGE"
92102
try:

0 commit comments

Comments
 (0)