Skip to content

Commit c910445

Browse files
committed
fix handler
1 parent feabeaf commit c910445

9 files changed

Lines changed: 31 additions & 31 deletions
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from models import sample_func
1+
import sample_func
22

33

44
def test_add():

test_pytest_exception_handler.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import pytest
2+
from sample_func import add, subtract, multiply, division
3+
4+
5+
def test_add():
6+
assert add(3, 4) == 7
7+
assert add(-1, 4) == 3
8+
assert add(0, 4) == 4
9+
10+
11+
def test_subtract():
12+
assert subtract(3, 4) == -1
13+
assert subtract(-1, 4) == -5
14+
assert subtract(0, 4) == -4
15+
16+
17+
def test_multiply():
18+
assert multiply(3, 4) == 12
19+
assert multiply(3, 4) != 11
20+
assert multiply(-1, 4) == -4
21+
assert multiply(0, 4) == 0
22+
23+
24+
def test_division():
25+
assert division(12, 4) == 3
26+
with pytest.raises(ZeroDivisionError):
27+
division(2, 0)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pytest
44

5-
from models.person import Person
5+
from person import Person
66

77

88
class TestPerson:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22

3-
from models.sample_func import add, subtract, multiply, division
3+
from sample_func import add, subtract, multiply, division
44

55

66
class TestOne(unittest.TestCase):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22

3-
from models.person import Person
3+
from person import Person
44

55

66
class TestPerson(unittest.TestCase):

tests/test_pytest_exception_handler.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)