def test_assert_results_contain_failure_string_msg(capsys):
    msg_code = 'a message code'
    expected_status = PASS
    results = [(DEBUG, msg_code)]
    exception_message = f'''Expected to find {expected_status}, [code: {msg_code}]
But did not find it in:
{results}'''
    with pytest.raises(Exception) as err:
        assert_results_contain(results, expected_status, msg_code)
    assert (str(err.value) == exception_message)
    captured = capsys.readouterr()
    assert (captured.out == f'''Test {expected_status} [{msg_code}]
''')
def test_assert_results_contain_failure_string_msg(capsys):
    msg_code = 'a message code'
    expected_status = PASS
    results = [(DEBUG, msg_code)]
    exception_message = f'Expected to find {expected_status}, [code: {msg_code}]
But did not find it in:
{results}'
    with pytest.raises(Exception) as err:
        assert_results_contain(results, expected_status, msg_code)
    assert (str(err.value) == exception_message)
    captured = capsys.readouterr()
    assert (captured.out == f'Test {expected_status} [{msg_code}]
')