Created
March 14, 2017 03:09
-
-
Save AndyLPK247/97c1cc07b42507ff92d3eec4e8bb8d06 to your computer and use it in GitHub Desktop.
Python Testing 101 pytest Examples: Math Function Tests (3)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pytest.mark.parametrize("a,b,expected", [ | |
(NUMBER_1, NUMBER_2, NUMBER_1), | |
(NUMBER_2, NUMBER_1, NUMBER_1), | |
(NUMBER_1, NUMBER_1, NUMBER_1), | |
]) | |
def test_maximum(a, b, expected): | |
assert maximum(a, b) == expected | |
@pytest.mark.parametrize("a,b,expected", [ | |
(NUMBER_1, NUMBER_2, NUMBER_2), | |
(NUMBER_2, NUMBER_1, NUMBER_2), | |
(NUMBER_2, NUMBER_2, NUMBER_2), | |
]) | |
def test_minimum(a, b, expected): | |
assert minimum(a, b) == expected |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment