Skip to content

Commit 8328861

Browse files
committed
add tests
1 parent d6b46c4 commit 8328861

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed
Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
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+
is_prime(-4) == True
8+
9+
def test_prime():
10+
is_prime(1441) == True
11+
12+
def test_not_prime():
13+
is_prime(1000) == False
14+
15+
16+
def test_big_number():
17+
is_prime(1000000) == False
18+
19+
# This should fail
20+
def test_invalid_input():
21+
with pytest.raises(TypeError):
22+
is_prime("13") == True

0 commit comments

Comments
 (0)