我运行pytest.main([])的时候为什么我填入什么参数他都没效果,错的参数也不会报错,对的也不会按参数执行。
import pytest
class Test_case:
def test_01(self):
print('1')
@pytest.mark.test
def test_02(self):
print('2')
if name == 'main':
pytest.main(['-s','-m test'])
collecting ... collected 2 items
test_runnrt.py::Test_case::test_01 PASSED [ 50%]1
test_runnrt.py::Test_case::test_02 PASSED [100%]2
Process finished with exit code 0
然后我把pytest.main(['aksdjkad']) 乱填参数执行出来也不报错 也是上面的这个结果 为什么啊。 我设置里也选了pytest运行的啊