【pytest】(三) pytest运行多个文件

1.运行多个测试文件

pytest 会运行 test_ 开头 或者 _test 结尾的文件,在当前目录和子目录中

2. 一个类下的多个用例的运行, pytest会找到 test_ 开头的方法

import pytest

class TestClass(object):

	def test_one(self):
		x = "this"
		assert 'h' in x

	def test_two(self):
		x = "hello"
		assert hasattr(x, 'check')


运行一下,-q 是 在安静模式下运行

posted @ 2018-08-28 08:55  把苹果咬哭的测试笔记  阅读(4418)  评论(0编辑  收藏  举报