I've been using command line options for years, but they no longer work for
me. I get the message "unrecognized arguments".

As a sanity check, I used the example from the documentation on
https://docs.pytest.org/en/latest/example/simple.html?highlight=addoption

~~~~~
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")

~~~~~

(v3)$ pytest --cmdopt=type2

usage: pytest [options] [file_or_dir] [file_or_dir] [...]

pytest: error: unrecognized arguments: --cmdopt=type2

  inifile: None

  rootdir: /Users/derek/dev/example/example

​I'm using pytest-3.6.4 on OSX Sierra
​


-- 
thanks,
--derek
_______________________________________________
pytest-dev mailing list
pytest-dev@python.org
https://mail.python.org/mailman/listinfo/pytest-dev

Reply via email to