MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / eq_ignore_whitespace

Function eq_ignore_whitespace

lib/sqlalchemy/testing/assertions.py:361–369  ·  view source on GitHub ↗
(a, b, msg=None)

Source from the content-addressed store, hash-verified

359
360
361def eq_ignore_whitespace(a, b, msg=None):
362 a = re.sub(r"^\s+?|\n", "", a)
363 a = re.sub(r" {2,}", " ", a)
364 a = re.sub(r"\t", "", a)
365 b = re.sub(r"^\s+?|\n", "", b)
366 b = re.sub(r" {2,}", " ", b)
367 b = re.sub(r"\t", "", b)
368
369 assert a == b, msg or "%r != %r" % (a, b)
370
371
372def _assert_proper_exception_context(exception):

Calls 1

subMethod · 0.80