MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / eval_eq

Function eval_eq

test/orm/dml/test_evaluator.py:32–46  ·  view source on GitHub ↗
(clause, testcases=None)

Source from the content-addressed store, hash-verified

30
31
32def eval_eq(clause, testcases=None):
33 evaluator = compiler.process(clause)
34
35 def testeval(obj=None, expected_result=None):
36 assert evaluator(obj) == expected_result, "%s != %r for %s with %r" % (
37 evaluator(obj),
38 expected_result,
39 clause,
40 obj,
41 )
42
43 if testcases:
44 for an_obj, result in testcases:
45 testeval(an_obj, result)
46 return testeval
47
48
49class EvaluateTest(fixtures.MappedTest):

Callers 11

test_compare_to_valueMethod · 0.85
test_compare_to_noneMethod · 0.85
test_true_falseMethod · 0.85
test_boolean_opsMethod · 0.85
test_string_opsMethod · 0.85
test_inMethod · 0.85
test_in_tuplesMethod · 0.85
test_null_propagationMethod · 0.85
test_hybridsMethod · 0.85
test_custom_opMethod · 0.85

Calls 2

testevalFunction · 0.85
processMethod · 0.45

Tested by

no test coverage detected