(pytester: Pytester, monkeypatch: MonkeyPatch)
| 1177 | |
| 1178 | |
| 1179 | def test_trace(pytester: Pytester, monkeypatch: MonkeyPatch) -> None: |
| 1180 | calls = [] |
| 1181 | |
| 1182 | def check_call(*args, **kwargs): |
| 1183 | calls.append((args, kwargs)) |
| 1184 | assert args == ("runcall",) |
| 1185 | |
| 1186 | class _pdb: |
| 1187 | def runcall(*args, **kwargs): |
| 1188 | calls.append((args, kwargs)) |
| 1189 | |
| 1190 | return _pdb |
| 1191 | |
| 1192 | monkeypatch.setattr("_pytest.debugging.pytestPDB._init_pdb", check_call) |
| 1193 | |
| 1194 | p1 = pytester.makepyfile( |
| 1195 | """ |
| 1196 | import unittest |
| 1197 | |
| 1198 | class MyTestCase(unittest.TestCase): |
| 1199 | def test(self): |
| 1200 | self.assertEqual('foo', 'foo') |
| 1201 | """ |
| 1202 | ) |
| 1203 | result = pytester.runpytest("--trace", str(p1)) |
| 1204 | assert len(calls) == 2 |
| 1205 | assert result.ret == 0 |
| 1206 | |
| 1207 | |
| 1208 | def test_pdb_teardown_called(pytester: Pytester, monkeypatch: MonkeyPatch) -> None: |
nothing calls this directly
no test coverage detected