run multiple test cases pytest
@pytest.mark.parametrize("input, expected", [
(1, True),
(2, True)
])
def test_check_value(input, expected):
assert input > 0 == expected
run multiple test cases pytest
@pytest.mark.parametrize("input, expected", [
(1, True),
(2, True)
])
def test_check_value(input, expected):
assert input > 0 == expected
how to group multiple test in pytest
# content of test_class.py
class TestClass:
def test_one(self):
x = "this"
assert "h" in x
def test_two(self):
x = "hello"
assert hasattr(x, "check")
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us