(self)
| 400 | @refcount_test |
| 401 | @requires_gil_enabled('needs precise allocation counts') |
| 402 | def test_get_count(self): |
| 403 | gc.collect() |
| 404 | a, b, c = gc.get_count() |
| 405 | x = [] |
| 406 | d, e, f = gc.get_count() |
| 407 | self.assertEqual((b, c), (0, 0)) |
| 408 | self.assertEqual((e, f), (0, 0)) |
| 409 | # This is less fragile than asserting that a equals 0. |
| 410 | self.assertLess(a, 5) |
| 411 | # Between the two calls to get_count(), at least one object was |
| 412 | # created (the list). |
| 413 | self.assertGreater(d, a) |
| 414 | |
| 415 | @refcount_test |
| 416 | def test_collect_generations(self): |
nothing calls this directly
no test coverage detected