(self)
| 377 | gc.set_threshold(*thresholds) |
| 378 | |
| 379 | def test_del_newclass(self): |
| 380 | # __del__ methods can trigger collection, make this to happen |
| 381 | thresholds = gc.get_threshold() |
| 382 | gc.enable() |
| 383 | gc.set_threshold(1) |
| 384 | |
| 385 | class A(object): |
| 386 | def __del__(self): |
| 387 | dir(self) |
| 388 | a = A() |
| 389 | del a |
| 390 | |
| 391 | gc.disable() |
| 392 | gc.set_threshold(*thresholds) |
| 393 | |
| 394 | # The following two tests are fragile: |
| 395 | # They precisely count the number of allocations, |