()
| 31 | |
| 32 | |
| 33 | def test_real_func_loop_limit() -> None: |
| 34 | class Evil: |
| 35 | def __init__(self): |
| 36 | self.left = 1000 |
| 37 | |
| 38 | def __repr__(self): |
| 39 | return f"<Evil left={self.left}>" |
| 40 | |
| 41 | def __getattr__(self, attr): |
| 42 | if not self.left: |
| 43 | raise RuntimeError("it's over") # pragma: no cover |
| 44 | self.left -= 1 |
| 45 | return self |
| 46 | |
| 47 | evil = Evil() |
| 48 | |
| 49 | with pytest.raises( |
| 50 | ValueError, |
| 51 | match=( |
| 52 | "could not find real function of <Evil left=800>\n" |
| 53 | "stopped at <Evil left=800>" |
| 54 | ), |
| 55 | ): |
| 56 | get_real_func(evil) |
| 57 | |
| 58 | |
| 59 | def test_get_real_func() -> None: |
nothing calls this directly
no test coverage detected