Skip to content

Instantly share code, notes, and snippets.

@AndyLPK247
Created March 14, 2017 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndyLPK247/97c1cc07b42507ff92d3eec4e8bb8d06 to your computer and use it in GitHub Desktop.
Save AndyLPK247/97c1cc07b42507ff92d3eec4e8bb8d06 to your computer and use it in GitHub Desktop.
Python Testing 101 pytest Examples: Math Function Tests (3)
@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