def test_correct_strings(
    parse_tokens,
    assert_errors,
    default_options,
    code,
):
    """Ensures that correct strings are fine."""
    file_tokens = parse_tokens(code)

    visitor = WrongStringConcatenationVisitor(
        default_options, file_tokens=file_tokens,
    )
    visitor.run()

    assert_errors(visitor, [])
def test_implicit_string_concatenation(
    parse_tokens,
    assert_errors,
    default_options,
    code,
):
    """Ensures that implicit string concatenation raise a warning."""
    file_tokens = parse_tokens(code, do_compile=False)

    visitor = WrongStringConcatenationVisitor(
        default_options, file_tokens=file_tokens,
    )
    visitor.run()

    assert_errors(visitor, [ImplicitStringConcatenationViolation])