def generate_exchanges(): for exch in input_(args.path): if args.silence: exch.silence(args.silence) check_exchange(exch) n_notices.update(complaint.severity for obj in [exch] + exch.children for complaint in obj.complaints) yield exch
def generate_exchanges(): for exch in input_(args.path): if args.silence: exch.silence(args.silence) check_exchange(exch) n_notices.update(notice.severity for obj in [exch] + exch.children for notice in obj.notices) yield exch
def test_from_file(input_from_file): # pylint: disable=redefined-outer-name (exchanges, expected) = input_from_file for exch in exchanges: check_exchange(exch) buf = six.BytesIO() text_report(exchanges, buf) actual = sorted( int(ln[2:6]) for ln in buf.getvalue().decode('utf-8').splitlines() if not ln.startswith(u'----')) assert expected == actual html_report(exchanges, six.BytesIO()) # Just check that it doesn't fail
def test_from_file(input_from_file): # pylint: disable=redefined-outer-name (exchanges, expected) = input_from_file for exch in exchanges: check_exchange(exch) buf = six.BytesIO() text_report(exchanges, buf) actual = sorted(int(ln[2:6]) for ln in buf.getvalue().decode('utf-8').splitlines() if not ln.startswith(u'----')) covered.update(actual) assert expected == actual html_report(exchanges, six.BytesIO()) # Just check that it doesn't fail
def test_from_file(input_from_file): # pylint: disable=redefined-outer-name (exchanges, expected) = input_from_file for exch in exchanges: check_exchange(exch) buf = io.BytesIO() text_report(exchanges, buf) actual = sorted( int(ln[2:6]) for ln in buf.getvalue().decode('utf-8').splitlines() if not ln.startswith(u'----')) assert expected == actual buf = io.BytesIO() html_report(exchanges, buf) # Check that the report does not contain strings that look like default # Python object reprs, meaning that we failed to render something. # This pops up from time to time. assert not re.search(b'<[^>]+ at 0x[0-9a-fA-F]+>', buf.getvalue())
def test_from_file(input_from_file): # pylint: disable=redefined-outer-name (exchanges, expected) = input_from_file for exch in exchanges: check_exchange(exch) buf = io.BytesIO() text_report(exchanges, buf) actual = sorted(int(ln[2:6]) for ln in buf.getvalue().decode('utf-8').splitlines() if not ln.startswith(u'----')) assert expected == actual buf = io.BytesIO() html_report(exchanges, buf) # Check that the report does not contain strings that look like default # Python object reprs, meaning that we failed to render something. # This pops up from time to time. assert not re.search(b'<[^>]+ at 0x[0-9a-fA-F]+>', buf.getvalue())
def generate_exchanges(): for exch in input_(args.path): if args.silence: exch.silence(args.silence) check_exchange(exch) yield exch