Skip to content

Commit 7db6a27

Browse files
committed
Adding tests for bytestring docstring
1 parent 20d0a60 commit 7db6a27

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-0
lines changed
1.69 KB
Binary file not shown.
1.21 KB
Binary file not shown.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
"""Module docstring"""
2+
class A:
3+
b"""Got \xe7\xfe Bytes?"""
4+
assert __doc__ == b"""Got \xe7\xfe Bytes?"""
5+
6+
def class_func(self):
7+
b"""Got \xe7\xfe Bytes?"""
8+
assert __doc__ == """Module docstring"""
9+
10+
class B:
11+
"""Got no Bytes?"""
12+
assert __doc__ == """Got no Bytes?"""
13+
14+
def class_func(self):
15+
"""Got no Bytes?"""
16+
assert __doc__ == """Module docstring"""
17+
18+
def single_func():
19+
"""single docstring?"""
20+
assert __doc__ == """Module docstring"""
21+
22+
def single_byte_func():
23+
b"""Got \xe7\xfe Bytes?"""
24+
assert __doc__ == """Module docstring"""
25+
26+
assert __doc__ == """Module docstring"""
27+
28+
assert single_func.__doc__ == """single docstring?"""
29+
single_func()
30+
31+
assert single_byte_func.__doc__ == b"""Got \xe7\xfe Bytes?"""
32+
single_byte_func()
33+
34+
assert A.__doc__ == b"""Got \xe7\xfe Bytes?"""
35+
assert A.class_func.__doc__ == b"""Got \xe7\xfe Bytes?"""
36+
a = A()
37+
assert a.class_func.__doc__ == b"""Got \xe7\xfe Bytes?"""
38+
a.class_func()
39+
40+
assert B.__doc__ == """Got no Bytes?"""
41+
assert B.class_func.__doc__ == """Got no Bytes?"""
42+
b = B()
43+
assert b.class_func.__doc__ == """Got no Bytes?"""
44+
b.class_func()
45+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
"""Module docstring"""
2+
class A:
3+
b"""Got \xe7\xfe Bytes?"""
4+
assert __doc__ == """Module docstring"""
5+
6+
def class_func(self):
7+
b"""Got \xe7\xfe Bytes?"""
8+
assert __doc__ == """Module docstring"""
9+
10+
class B:
11+
"""Got no Bytes?"""
12+
assert __doc__ == """Got no Bytes?"""
13+
14+
def class_func(self):
15+
"""Got no Bytes?"""
16+
assert __doc__ == """Module docstring"""
17+
18+
def single_func():
19+
"""single docstring?"""
20+
assert __doc__ == """Module docstring"""
21+
22+
def single_byte_func():
23+
b"""Got \xe7\xfe Bytes?"""
24+
assert __doc__ == """Module docstring"""
25+
26+
assert __doc__ == """Module docstring"""
27+
28+
assert single_func.__doc__ == """single docstring?"""
29+
single_func()
30+
31+
assert single_byte_func.__doc__ is None
32+
single_byte_func()
33+
34+
assert A.__doc__ is None
35+
assert A.class_func.__doc__ is None
36+
a = A()
37+
assert a.class_func.__doc__ is None
38+
a.class_func()
39+
40+
assert B.__doc__ == """Got no Bytes?"""
41+
assert B.class_func.__doc__ == """Got no Bytes?"""
42+
b = B()
43+
assert b.class_func.__doc__ == """Got no Bytes?"""
44+
b.class_func()
45+

0 commit comments

Comments
 (0)