Created
January 9, 2023 15:09
-
-
Save tomdewildt/95b2edf8928d6d048cdfe32e9535bffc to your computer and use it in GitHub Desktop.
Pytest syntax for the python programming language
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
# Test case | |
class TestExample: | |
def test_example_single(self): | |
value = function_to_test("value") | |
assert value == "test" | |
@pytest.mark.parametrize( | |
"function_input,function_output", | |
[ | |
("", None), | |
("value", "test"), | |
], | |
) | |
def test_example_multiple(self, function_input, function_output): | |
value = function_to_test(function_input) | |
assert value == function_output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment