📜  安装 pytest - Shell-Bash 代码示例

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

代码示例3
# 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")