py.test: erreur: unrecognized arguments

J'ai un répertoire de projet ressemble à ce qui suit

Projects/
....this_project/
........this_project/
............__init__.py
............code.py
............tests/
................conftest.py
................test_1.py
................test_2.py

et j'ai ajouté une option de ligne de commande (--PALLADIUM_CONFIG) en mettant les codes suivants dans conftest.py

def pytest_addoption(parser):
    parser.addoption("--PALLADIUM_CONFIG", action="store")

@pytest.fixture
def PALLADIUM_CONFIG(request):
    return request.config.getoption("--PALLADIUM_CONFIG")

Et ce qui est étrange, c'est:

si je cd dans

Projects/this_project/this_project

ou

Projects/this_project/this_project/tests

et exécuter

py.test --PALLADIUM_CONFIG=***

si fonctionne bien

mais si je me situer, par exemple, dans

Projects/this_project

ou

Projects

puis pytest me donne l'erreur

py.test: error: unrecognized arguments: --PALLADIUM_CONFIG=***

OriginalL'auteur Hello lad | 2015-07-20