(self, a, b, *, compare_values=False)
| 322 | |
| 323 | class CacheKeyFixture: |
| 324 | def _compare_equal(self, a, b, *, compare_values=False): |
| 325 | a_key = a._generate_cache_key() |
| 326 | b_key = b._generate_cache_key() |
| 327 | |
| 328 | if a_key is None: |
| 329 | assert a._annotations.get("nocache"), ( |
| 330 | "Construct doesn't cache, so test suite should " |
| 331 | "add the 'nocache' annotation" |
| 332 | ) |
| 333 | |
| 334 | assert b_key is None |
| 335 | else: |
| 336 | eq_(a_key.key, b_key.key) |
| 337 | eq_(hash(a_key.key), hash(b_key.key)) |
| 338 | |
| 339 | for a_param, b_param in zip(a_key.bindparams, b_key.bindparams): |
| 340 | assert a_param.compare(b_param, compare_values=compare_values) |
| 341 | return a_key, b_key |
| 342 | |
| 343 | def _run_compare_fixture(self, fixture, *, compare_values=False): |
| 344 | case_a = fixture() |
no test coverage detected