I have the following test directory structure and each has their own conftest.py:
tests/api
tests/api/newapi
tests/sanity
In conftest.py, pytest_addoption has identical option entry as test_option:
parser.addoption("--test_option", dest="test_option", type="string", help="test_option")
Execute py.test at tests/api/newapi has following error:
optparse.OptionConflictError: option --test_option: conflicting option string(s): --test_option
But execute py.test at tests/api or tests or tests/sanity works fine. Is this by design that I must come up with a new option name if the parent directory has same option name?
I was hoping that I can keep the naming convention the same since the option in question serve the same purpose for the test. The intent is to vary the level of detail in testing depending on which directory the test was kicked off from.