def test_comment_at_first_character_python_indented_comments(): """Don't handle indented comments.""" text = cleandoc( """ # Hello # world """ ) expected = "# Hello" assert PythonCommentStyle.comment_at_first_character(text) == expected
def test_comment_at_first_character_python(): """Find the comment block at the first character.""" text = cleandoc(""" # Hello # world Spam """) expected = cleandoc(""" # Hello # world """) assert PythonCommentStyle.comment_at_first_character(text) == expected
def test_comment_at_first_character_python_no_comment(): """The text does not start with a comment character.""" with pytest.raises(CommentParseError): PythonCommentStyle.comment_at_first_character(" # Hello world")