1.断言用assert,可以进行==,!=,+,-,*,/,<=,>=,is True.False,is not True.False ,in ,not in 等判断. import pytestdef add(a,b): return a + b def is_prime(n): if n <= 1: return False for i in range(2,n): if n % i == 0: return False return True def test_add_1(): '…
pytest是什么 官方文档描述: pytest is a framework that makes building simple and scalable tests easy. Tests are expressive and readable-no boilerplate code required. Get started in minutes with a small unit test or complex functional test for your application…