pass_test.py
def test_passing():
assert (1, 2, 3) == (1, 2, 3)
执行
pytest pass_test.py
pass_test.py 后的点表示一个测试运行并通过。 如果你需要更多信息,您可以使用v
pytest pass_test.py -v
fail test.py
def test_failing():
assert (1,2,3)==(3,2,1)
执行
pytest fail_test.py
执行
pytest fail_test.py -v