MCPcopy Index your code
hub / github.com/zzzeek/sqlalchemy / _compare_equal

Method _compare_equal

lib/sqlalchemy/testing/fixtures/sql.py:324–341  ·  view source on GitHub ↗
(self, a, b, *, compare_values=False)

Source from the content-addressed store, hash-verified

322
323class 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()

Callers 2

Calls 4

eq_Function · 0.85
_generate_cache_keyMethod · 0.45
getMethod · 0.45
compareMethod · 0.45

Tested by

no test coverage detected