#coding:utf-8 import os cmd = "pytest -v -m \"not webtest\"" os.system(cmd)
通过os.system执行cmd命令(pytest -v -m "not webtest"),因为cmd命令中有双引号,随意要加转义符\