Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions byexample/expected.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -396,7 +396,7 @@ def _get_captures_by_incremental_match(
>>> expected = r'aa<foo>bb<b-r>ddd<baz>eee<z-z>cc'
>>> got = r'aaAAbbBBxxxddeeeCCcc'

>>> expected_regexs = ['\A', 'aa', '(?P<foo>.*?)', 'bb',
>>> expected_regexs = ['\\A', 'aa', '(?P<foo>.*?)', 'bb',
... '(?P<b_r>.*?)', 'ddd', '(?P<baz>.*?)',
... 'eee', '(?P<z_z>.*?)', 'cc', r'\n*\Z']
>>> charnos = [0, 0, 2, 7, 9, 14, 17, 22, 25, 30, 32]
Expand All @@ -423,7 +423,7 @@ def _get_captures_by_incremental_match(
>>> expected = 'aa<foo>bb\ncc\ndd<bar>ee'
>>> got = 'aaAAbb\nxx\nxxAAee'

>>> expected_regexs = ['\A', 'aa', '(?P<foo>.*?)', 'bb\n',
>>> expected_regexs = ['\\A', 'aa', '(?P<foo>.*?)', 'bb\n',
... 'cc\n', 'dd', '(?P<bar>.*?)',
... 'ee', r'\n*\Z']
>>> charnos = [0, 0, 2, 7, 10, 13, 15, 20, 22]
Expand All @@ -442,7 +442,7 @@ def _get_captures_by_incremental_match(

>>> expected = 'aa<foo>bb\ncc\ndd<foo>ee'

>>> expected_regexs = ['\A', 'aa', '(?P<foo>.*?)', 'bb\n',
>>> expected_regexs = ['\\A', 'aa', '(?P<foo>.*?)', 'bb\n',
... 'cc\n', 'dd', '(?P=foo)',
... 'ee', r'\n*\Z']
>>> rcounts = [0, 2, 0, 3, 3, 2, 1, 2, 0] # notice the +1
Expand Down
2 changes: 2 additions & 0 deletions byexample/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Loading