def test_formatter_with_context(record, context): log = AddContextFormatter().format(record) assert log.strip() == '{} {}'.format(record.message, 'rid:42')
def test_formatter_no_context(record): log = AddContextFormatter().format(record) assert log.strip() == record.message