Answers for "testing with pytest"

0

pytest

# 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")
Posted by: Guest on November-20-2021
0

test a file pytest

pytest PATH/TO/FILE.py
Posted by: Guest on October-14-2021

Python Answers by Framework

Browse Popular Code Answers by Language