我正在尝试使用pytest框架构建和运行测试套件(selenium,这与此无关)。
我编写了一个简单的测试如下
class test_pqr():
def test_lmn(self):
print("AAAAAAAAAAAAAAAAAAAAA")
assert True
def test_xyz(self):
assert False
x= test_pqr()
x.test_lmn()当我运行它时我得到了结果..。

如果我也运行xyz ..。例如
class test_pqr():
def test_lmn(self):
print("AAAAAAAAAAAAAAAAAAAAA")
assert True
def test_xyz(self):
assert False
x= test_pqr()
x.test_lmn()
x.test_xyz()结果就像..。

什么剂量
运行pytest.main之前导入的单元测试
错误意味着?
为什么它不能发现测试呢?
收集了0项
为什么只有在出现错误时才运行方法?
发布于 2018-04-04 23:28:09
经过长时间的搜索和反复试验,找到了罪魁祸首。你应该给Test_*..类命名
类的大写字母T
方法在较低的情况下。
虽然测试按设想运行,但错误仍然存在.
https://stackoverflow.com/questions/49642618
复制相似问题