Skip to content

Commit 56acc03

Browse files
committed
add tests
1 parent d6b46c4 commit 56acc03

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed
Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11
from prime import is_prime
2+
import pytest
23

34

4-
# some code testing is_prime...
5+
# some code testing is_prime...
6+
def test_negative():
7+
assert is_prime(-4) is False
8+
9+
10+
def test_prime():
11+
assert is_prime(67) is True
12+
13+
14+
def test_not_prime():
15+
assert is_prime(1000) is False
16+
17+
18+
def test_big_number():
19+
assert is_prime(1000000) is False
20+
21+
22+
# This should fail
23+
def test_invalid_input():
24+
with pytest.raises(TypeError):
25+
assert is_prime("13") is True

0 commit comments

Comments
 (0)