MCPcopy Create free account
hub / github.com/pytest-dev/pytest / Evil

Class Evil

testing/test_compat.py:34–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33def 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

Callers 1

Calls

no outgoing calls

Tested by 1