We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5df36f5 commit 391282eCopy full SHA for 391282e
test_pytest_exception_handler.py
@@ -0,0 +1,27 @@
1
+import pytest
2
+import sample_func
3
+
4
5
+def test_add():
6
+ assert sample_func.add(3, 4) == 7
7
+ assert sample_func.add(-1, 4) == 3
8
+ assert sample_func.add(0, 4) == 4
9
10
11
+def subtract():
12
+ assert sample_func.subtract(3, 4) == -1
13
+ assert sample_func.subtract(-1, 4) == -5
14
+ assert sample_func.subtract(0, 4) == -4
15
16
17
+def multiply():
18
+ assert sample_func.multiply(3, 4) == 12
19
+ assert sample_func.multiply(3, 4) != 11
20
+ assert sample_func.multiply(-1, 4) == -4
21
+ assert sample_func.multiply(0, 4) == 0
22
23
24
+def division():
25
+ assert sample_func.multiply(12, 4) == 3
26
+ with pytest.raises(ZeroDivisionError):
27
+ sample_func.division(2, 0)
0 commit comments