(tmp_path: Path)
| 942 | |
| 943 | |
| 944 | def 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 | |
| 974 | class TestNonPython: |
nothing calls this directly
no test coverage detected