(self, code)
| 2572 | N = 100 |
| 2573 | |
| 2574 | def check_stack_size(self, code): |
| 2575 | # To assert that the alleged stack size is not O(N), we |
| 2576 | # check that it is smaller than log(N). |
| 2577 | if isinstance(code, str): |
| 2578 | code = compile(code, "<foo>", "single") |
| 2579 | max_size = math.ceil(math.log(len(code.co_code))) |
| 2580 | self.assertLessEqual(code.co_stacksize, max_size) |
| 2581 | |
| 2582 | def test_and(self): |
| 2583 | self.check_stack_size("x and " * self.N + "x") |
nothing calls this directly
no test coverage detected
searching dependent graphs…