MCPcopy Index your code
hub / github.com/pytest-dev/pytest-xdist / test_failure_change

Method test_failure_change

testing/test_looponfail.py:134–163  ·  view source on GitHub ↗
(self, pytester: pytest.Pytester)

Source from the content-addressed store, hash-verified

132 assert not failures
133
134 def test_failure_change(self, pytester: pytest.Pytester) -> None:
135 modcol = pytester.getitem(
136 textwrap.dedent(
137 """
138 def test_func():
139 assert 0
140 """
141 )
142 )
143 control = RemoteControl(modcol.config)
144 control.loop_once()
145 assert control.failures
146 modcol_path = modcol.path
147
148 modcol_path.write_text(
149 textwrap.dedent(
150 """
151 def test_func():
152 assert 1
153 def test_new():
154 assert 0
155 """
156 )
157 )
158 removepyc(modcol_path)
159 control.loop_once()
160 assert not control.failures
161 control.loop_once()
162 assert control.failures
163 assert str(control.failures).find("test_new") != -1
164
165 def test_failure_subdir_no_init(
166 self, pytester: pytest.Pytester, monkeypatch: pytest.MonkeyPatch

Callers

nothing calls this directly

Calls 3

loop_onceMethod · 0.95
RemoteControlClass · 0.90
removepycFunction · 0.85

Tested by

no test coverage detected