forked from nhs-r-community/github_actions_workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_main.py
More file actions
45 lines (36 loc) · 753 Bytes
/
test_main.py
File metadata and controls
45 lines (36 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
Tests for main.py
"""
import pytest
import main
@pytest.mark.parametrize(
["num_1", "num_2", "expected"],
[
(0, 0, 0),
(1, 1, 2),
(1, -1, 0),
(0.1, 0.1, 0.2),
]
)
def test_example_add(num_1, num_2, expected):
"""
Tests main.example_add
"""
actual = main.example_add(num_1, num_2)
assert actual==expected
@pytest.mark.parametrize(
["num_1", "num_2", "expected"],
[
(0, 0, 0),
(1, 1, 2),
(1, -1, 0),
(0.1, 0.1, 0.2),
]
)
@pytest.mark.skip('WIP not fixed yet!')
def test_example_bad_add(num_1, num_2, expected):
"""
Tests main.example_bad_add
"""
actual = main.example_bad_add(num_1, num_2)
assert actual==expected