(expected, received, variance)
| 273 | |
| 274 | |
| 275 | def 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 | |
| 286 | def eq_regex(a, b, msg=None, flags=0): |
no outgoing calls