📜  pytest - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:42.438000             🧑  作者: Mango

代码示例2
# content of conftest.py @by github -> linkerunk
import pytest


def pytest_addoption(parser):
    parser.addoption(
        "--cmdopt", action="store", default="type1", help="my option: type1 or type2"
    )


@pytest.fixture
def cmdopt(request):
    return request.config.getoption("--cmdopt")