I run pytest from command line using the command:
python -m pytest tests --server_image default
where --server_image is an argument defined in conftest.py file:
def pytest_addoption(parser):
parser.addoption("--server_image", action="store_true", default="build_image")
parser.addoption("--other_attr", action="store_true", default="True")
...
with 2 possible string values build_image and default. tests is a directory with the tests. I got an error message ERROR: file or directory not found: default. So pytest treats default as path to the test directory and not as a value of the argument. When i do not pass any argument everything works. Pytest version 7.0.0, python 3.8.12. Does anyone have a clue what could be wrong?