()
| 18 | |
| 19 | |
| 20 | def test_real_func_loop_limit() -> None: |
| 21 | class Evil: |
| 22 | def __init__(self): |
| 23 | self.left = 1000 |
| 24 | |
| 25 | def __repr__(self): |
| 26 | return f"<Evil left={self.left}>" |
| 27 | |
| 28 | def __getattr__(self, attr): |
| 29 | if not self.left: |
| 30 | raise RuntimeError("it's over") # pragma: no cover |
| 31 | self.left -= 1 |
| 32 | return self |
| 33 | |
| 34 | evil = Evil() |
| 35 | |
| 36 | with pytest.raises( |
| 37 | ValueError, |
| 38 | match=("wrapper loop when unwrapping <Evil left=998>"), |
| 39 | ): |
| 40 | get_real_func(evil) |
| 41 | |
| 42 | |
| 43 | def test_get_real_func() -> None: |
nothing calls this directly
no test coverage detected