Make SimpleTestCase picklable for parallel tests using subtests.
(self)
| 314 | self._setup_and_call(result) |
| 315 | |
| 316 | def __getstate__(self): |
| 317 | """ |
| 318 | Make SimpleTestCase picklable for parallel tests using subtests. |
| 319 | """ |
| 320 | state = super().__dict__ |
| 321 | # _outcome and _subtest cannot be tested on picklability, since they |
| 322 | # contain the TestCase itself, leading to an infinite recursion. |
| 323 | if state["_outcome"]: |
| 324 | pickable_state = {"_outcome": None, "_subtest": None} |
| 325 | for key, value in state.items(): |
| 326 | if key in pickable_state or not is_pickable(value): |
| 327 | continue |
| 328 | pickable_state[key] = value |
| 329 | return pickable_state |
| 330 | |
| 331 | return state |
| 332 | |
| 333 | def debug(self): |
| 334 | """Perform the same as __call__(), without catching the exception.""" |
nothing calls this directly
no test coverage detected