MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / int_within_variance

Function int_within_variance

lib/sqlalchemy/testing/assertions.py:275–283  ·  view source on GitHub ↗
(expected, received, variance)

Source from the content-addressed store, hash-verified

273
274
275def int_within_variance(expected, received, variance):
276 deviance = int(expected * variance)
277 assert (
278 abs(received - expected) < deviance
279 ), "Given int value %s is not within %d%% of expected value %s" % (
280 received,
281 variance * 100,
282 expected,
283 )
284
285
286def eq_regex(a, b, msg=None, flags=0):

Callers 1

test_cache_key_genMethod · 0.90

Calls

no outgoing calls

Tested by 1

test_cache_key_genMethod · 0.72