MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_dont_configure_on_workers

Function test_dont_configure_on_workers

testing/test_junitxml.py:944–971  ·  view source on GitHub ↗
(tmp_path: Path)

Source from the content-addressed store, hash-verified

942
943
944def test_dont_configure_on_workers(tmp_path: Path) -> None:
945 gotten: List[object] = []
946
947 class FakeConfig:
948 if TYPE_CHECKING:
949 workerinput = None
950
951 def __init__(self):
952 self.pluginmanager = self
953 self.option = self
954 self.stash = Stash()
955
956 def getini(self, name):
957 return "pytest"
958
959 junitprefix = None
960 # XXX: shouldn't need tmp_path ?
961 xmlpath = str(tmp_path.joinpath("junix.xml"))
962 register = gotten.append
963
964 fake_config = cast(Config, FakeConfig())
965 from _pytest import junitxml
966
967 junitxml.pytest_configure(fake_config)
968 assert len(gotten) == 1
969 FakeConfig.workerinput = None
970 junitxml.pytest_configure(fake_config)
971 assert len(gotten) == 1
972
973
974class TestNonPython:

Callers

nothing calls this directly

Calls 2

FakeConfigClass · 0.70
pytest_configureMethod · 0.45

Tested by

no test coverage detected