标签:imu ted span inf while bsp 测试案例 dir 上下
# content of test_tmpdir.py def test_needsfiles(tmpdir): print(tmpdir) assert 0
$ pytest -q test_tmpdir.py
def test_recursion_depth(): with pytest.raises(RuntimeError) as excinfo: def f(): f() f() assert "maximum recursion" in str(excinfo.value)
from test_foocompare import Foo def pytest_assertrepr_compare(op, left, right): if isinstance(left, Foo) and isinstance(right, Foo) and op == "==": return [ "Comparing Foo instances:", " vals: {} != {}".format(left.val, right.val), ]
# content of test_foocompare.py class Foo: def __init__(self, val): self.val = val def __eq__(self, other): return self.val == other.val def test_compare(): f1 = Foo(1) f2 = Foo(2) assert f1 == f2
Exit code 0:
|
All tests were collected and passed successfully
|
所有测试均已收集并成功通过
|
Exit code 1:
|
Tests were collected and run but some of the tests failed
|
测试已收集并运行,但有些测试失败
|
Exit code 2:
|
Test execution was interrupted by the user
|
测试执行被用户中断
|
Exit code 3:
|
Internal error happened while executing tests
|
执行测试时发生内部错误
|
Exit code 4:
|
pytest command line usage error
|
pytest命令行用法错误
|
Exit code 5:
|
No tests were collected
|
没有收集测试
|
标签:imu ted span inf while bsp 测试案例 dir 上下
原文地址:https://www.cnblogs.com/fine-6/p/12625454.html