How to skip tests based on condition in pytest?
问题 Below is the snippet of conftest.py , which accepts command line arguments. conftest.py import sys,json,pytest import logging def tear_down(): logging.info(" tear-down after all tests") def pytest_addoption(parser): parser.addoption("--a1", action="store", default="default_a1", help="value of a1") parser.addoption("--b1", action="store", default="default_b1", help="value of b1") @pytest.fixture(scope="class",autouse=True) def set_up(request): logging.info("set-up before all tests") a1 =