Answers for "run multiple test cases pytest"

0

run multiple test cases pytest

@pytest.mark.parametrize("input, expected", [
 (1, True),
 (2, True)
])
def test_check_value(input, expected):
  assert input > 0 == expected
Posted by: Guest on March-11-2022
0

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")
Posted by: Guest on December-19-2021

Python Answers by Framework

Browse Popular Code Answers by Language