(self)
| 2106 | self.assertEqual(f.cache_parameters(), {'maxsize': 1000, "typed": True}) |
| 2107 | |
| 2108 | def test_lru_cache_weakrefable(self): |
| 2109 | @self.module.lru_cache |
| 2110 | def test_function(x): |
| 2111 | return x |
| 2112 | |
| 2113 | class A: |
| 2114 | @self.module.lru_cache |
| 2115 | def test_method(self, x): |
| 2116 | return (self, x) |
| 2117 | |
| 2118 | @staticmethod |
| 2119 | @self.module.lru_cache |
| 2120 | def test_staticmethod(x): |
| 2121 | return (self, x) |
| 2122 | |
| 2123 | refs = [weakref.ref(test_function), |
| 2124 | weakref.ref(A.test_method), |
| 2125 | weakref.ref(A.test_staticmethod)] |
| 2126 | |
| 2127 | for ref in refs: |
| 2128 | self.assertIsNotNone(ref()) |
| 2129 | |
| 2130 | del A |
| 2131 | del test_function |
| 2132 | gc.collect() |
| 2133 | |
| 2134 | for ref in refs: |
| 2135 | self.assertIsNone(ref()) |
| 2136 | |
| 2137 | def test_common_signatures(self): |
| 2138 | def orig(a, /, b, c=True): ... |
nothing calls this directly
no test coverage detected