File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ pytrace
5050reportinfo
5151runpytest
5252superfences
53+ testinfra
5354testpaths
5455webservers
5556xunit
Original file line number Diff line number Diff line change 22
33from __future__ import annotations
44
5+ import importlib .util
56import logging
67import shutil
78import subprocess # noqa: S404
@@ -103,9 +104,16 @@ def pytest_addoption(parser: pytest.Parser) -> None:
103104
104105 Args:
105106 parser: pytest.Parser
107+
108+ Raises:
109+ pytest.UsageError: If pytest-testinfra is installed.
106110 """
107111 if not HAS_ANSIBLE :
108112 return
113+ spec = importlib .util .find_spec ("testinfra" )
114+ if spec is not None :
115+ msg = "pytest-ansible is incompatible with pytest-testinfra, see https://github.com/ansible/pytest-ansible/issues/509"
116+ raise pytest .UsageError (msg )
109117 group = parser .getgroup ("pytest-ansible" )
110118 group .addoption (
111119 "--inventory" ,
You can’t perform that action at this time.
0 commit comments