diff --git a/src/pytest_ansible/plugin.py b/src/pytest_ansible/plugin.py index 8b49e772..de704958 100644 --- a/src/pytest_ansible/plugin.py +++ b/src/pytest_ansible/plugin.py @@ -140,18 +140,11 @@ def pytest_addoption(parser): default=ansible.constants.DEFAULT_BECOME_ASK_PASS, help="ask for privilege escalation password (default: %(default)s)", ) - - group.addoption( - "--ansible-unit", - action="store_true", - default=False, - help="Enable support for ansible collection unit tests, inject paths and build the collection tree if needed.", - ) group.addoption( "--ansible-unit-inject-only", action="store_true", default=False, - help="Enable support for ansible collection unit tests, only inject exisiting ANSIBLE_COLLECTIONS_PATHS.", + help="Enable support for ansible collection unit tests by only injecting exisiting ANSIBLE_COLLECTIONS_PATHS.", ) # Add github marker to --help parser.addini("ansible", "Ansible integration", "args") @@ -177,7 +170,7 @@ def pytest_configure(config): if config.option.ansible_unit_inject_only: inject_only() - elif config.option.ansible_unit: + else: start_path = config.invocation_params.dir inject(start_path) diff --git a/tests/unit/test_unit.py b/tests/unit/test_unit.py index eae449e5..f40ef03a 100644 --- a/tests/unit/test_unit.py +++ b/tests/unit/test_unit.py @@ -79,5 +79,4 @@ def test_inject_only( def test_for_params(): """Test for params.""" proc = subprocess.run("pytest --help", shell=True, capture_output=True, check=False) - assert "--ansible-unit" in proc.stdout.decode() assert "--ansible-unit-inject-only" in proc.stdout.decode()