pytest测试

import pytest

#定义的函数必须以test开头
def test_a():
	print("test_a")
	assert 1

import pytest

#定义的函数必须以test开头
def test_a():
	print("test_a")
	assert 1

def test_b():
	print("test_b")
	assert 0

if __name__ == '__main__':
	pytest.main("pytest测试.py")

原文地址:https://www.cnblogs.com/gerenboke/p/13617000.html