diff --git a/byexample/expected.py b/byexample/expected.py index a1272c9..5544d36 100644 --- a/byexample/expected.py +++ b/byexample/expected.py @@ -348,7 +348,7 @@ def _get_captures_by_incremental_match( >>> expected = r'aa<...>bb<...>ddd<...>eee<...>cc' >>> got = r'aaAAbbBBxxxddeeeCCcc' - >>> expected_regexs = ['\A', 'aa', '(.*?)', 'bb', '(.*?)', 'ddd', + >>> expected_regexs = ['\\A', 'aa', '(.*?)', 'bb', '(.*?)', 'ddd', ... '(.*?)', 'eee', '(.*?)', 'cc', r'\n*\Z'] >>> charnos = [0, 0, 2, 7, 9, 14, 17, 22, 25, 30, 32] >>> rcounts = [0, 2, 0, 2, 0, 3, 0, 3, 0, 2, 0] @@ -396,7 +396,7 @@ def _get_captures_by_incremental_match( >>> expected = r'aabbdddeeecc' >>> got = r'aaAAbbBBxxxddeeeCCcc' - >>> expected_regexs = ['\A', 'aa', '(?P.*?)', 'bb', + >>> expected_regexs = ['\\A', 'aa', '(?P.*?)', 'bb', ... '(?P.*?)', 'ddd', '(?P.*?)', ... 'eee', '(?P.*?)', 'cc', r'\n*\Z'] >>> charnos = [0, 0, 2, 7, 9, 14, 17, 22, 25, 30, 32] @@ -423,7 +423,7 @@ def _get_captures_by_incremental_match( >>> expected = 'aabb\ncc\nddee' >>> got = 'aaAAbb\nxx\nxxAAee' - >>> expected_regexs = ['\A', 'aa', '(?P.*?)', 'bb\n', + >>> expected_regexs = ['\\A', 'aa', '(?P.*?)', 'bb\n', ... 'cc\n', 'dd', '(?P.*?)', ... 'ee', r'\n*\Z'] >>> charnos = [0, 0, 2, 7, 10, 13, 15, 20, 22] @@ -442,7 +442,7 @@ def _get_captures_by_incremental_match( >>> expected = 'aabb\ncc\nddee' - >>> expected_regexs = ['\A', 'aa', '(?P.*?)', 'bb\n', + >>> expected_regexs = ['\\A', 'aa', '(?P.*?)', 'bb\n', ... 'cc\n', 'dd', '(?P=foo)', ... 'ee', r'\n*\Z'] >>> rcounts = [0, 2, 0, 3, 3, 2, 1, 2, 0] # notice the +1 diff --git a/byexample/log.py b/byexample/log.py index 9baf3be..1ebda03 100644 --- a/byexample/log.py +++ b/byexample/log.py @@ -334,6 +334,7 @@ def log_with(logger_name, child=True): finally: _logger_stack.pop() + class _DummyRLock: ''' A dummy reentrant lock to emulate a lock (acquire/release) but without @@ -364,6 +365,7 @@ def __enter__(self): def __exit__(self, exc_type, exc_value, traceback): self.release() + class XStreamHandler(logging.StreamHandler): def __init__(self, *args, **kargs): logging.StreamHandler.__init__(self, *args, **kargs)