Adding tests for bytestring docstring

This commit is contained in:
gdesmar 2024-10-16 20:19:39 +00:00
parent 20d0a60550
commit 7db6a272af
No known key found for this signature in database
GPG Key ID: 99E35CDA9095D6BC
4 changed files with 90 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,45 @@
"""Module docstring"""
class A:
b"""Got \xe7\xfe Bytes?"""
assert __doc__ == b"""Got \xe7\xfe Bytes?"""
def class_func(self):
b"""Got \xe7\xfe Bytes?"""
assert __doc__ == """Module docstring"""
class B:
"""Got no Bytes?"""
assert __doc__ == """Got no Bytes?"""
def class_func(self):
"""Got no Bytes?"""
assert __doc__ == """Module docstring"""
def single_func():
"""single docstring?"""
assert __doc__ == """Module docstring"""
def single_byte_func():
b"""Got \xe7\xfe Bytes?"""
assert __doc__ == """Module docstring"""
assert __doc__ == """Module docstring"""
assert single_func.__doc__ == """single docstring?"""
single_func()
assert single_byte_func.__doc__ == b"""Got \xe7\xfe Bytes?"""
single_byte_func()
assert A.__doc__ == b"""Got \xe7\xfe Bytes?"""
assert A.class_func.__doc__ == b"""Got \xe7\xfe Bytes?"""
a = A()
assert a.class_func.__doc__ == b"""Got \xe7\xfe Bytes?"""
a.class_func()
assert B.__doc__ == """Got no Bytes?"""
assert B.class_func.__doc__ == """Got no Bytes?"""
b = B()
assert b.class_func.__doc__ == """Got no Bytes?"""
b.class_func()

View File

@ -0,0 +1,45 @@
"""Module docstring"""
class A:
b"""Got \xe7\xfe Bytes?"""
assert __doc__ == """Module docstring"""
def class_func(self):
b"""Got \xe7\xfe Bytes?"""
assert __doc__ == """Module docstring"""
class B:
"""Got no Bytes?"""
assert __doc__ == """Got no Bytes?"""
def class_func(self):
"""Got no Bytes?"""
assert __doc__ == """Module docstring"""
def single_func():
"""single docstring?"""
assert __doc__ == """Module docstring"""
def single_byte_func():
b"""Got \xe7\xfe Bytes?"""
assert __doc__ == """Module docstring"""
assert __doc__ == """Module docstring"""
assert single_func.__doc__ == """single docstring?"""
single_func()
assert single_byte_func.__doc__ is None
single_byte_func()
assert A.__doc__ is None
assert A.class_func.__doc__ is None
a = A()
assert a.class_func.__doc__ is None
a.class_func()
assert B.__doc__ == """Got no Bytes?"""
assert B.class_func.__doc__ == """Got no Bytes?"""
b = B()
assert b.class_func.__doc__ == """Got no Bytes?"""
b.class_func()