Skip to content

Instantly share code, notes, and snippets.

@wmvanvliet
Created April 13, 2021 10:59
Show Gist options
  • Save wmvanvliet/36471bb456151d93b86c402b64684b0a to your computer and use it in GitHub Desktop.
Save wmvanvliet/36471bb456151d93b86c402b64684b0a to your computer and use it in GitHub Desktop.
Test cases for python docstring highlighting
"""
This should be a docstring.
Second line of the docstring.
"""
"""This should not be a docstring."""
b"""This should not be a docstring."""
r"""This should not be a docstring."""
"This should not be a docstring."
def test1():
"""This should be a docstring."""
"""This should not be a docstring."""
def test2():
b"""This should not be a docstring."""
def test3():
r"""This should not be a docstring."""
def test4():
"This should not be a docstring."
def test5():
a = """This should not be a docstring"""
def test6():
b = """This
should not be
a docstring."""
def test7():
c = """This should not be
a docstring.
"""
def test8():
d = (
"""This should not be a docstring"""
)
def test9():
e = "This should not be a docstring"
class test10:
"""This should be a docstring."""
def __init__(self):
"""This should be a docstring.
Second line of the docstring.
"""
"""This should not be a docstring."""
def test11():"""Should not be a docstring"""
def test12():
'''This should be a docstring'''
pass
def test13(a:int) -> bool:
'''This should be a docstring'''
pass
def test14():
'''This should be a docstring'''
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment