pytest-mark跳过
作者:互联网
import pytest
import sys
environment='android'
@pytest.mark.skipif(environment=="android",reason='android平台没有这个功能,只有ios下有')
def test_add():
print("apple")
def test_add2():
print("android")
@pytest.mark.skipif(sys.platform=='win32',reason='不在win下运行')
@pytest.mark.skipif(sys.version_info<(3,6),reason='3.6以下不执行')
def test_add3():
print("windows")
标签:skipif,mark,test,pytest,print,android,跳过 来源: https://www.cnblogs.com/QaStudy/p/11563370.html