1 # This module is used in `test_doctest`.
2 # It must not have a docstring.
3
4 def func_with_docstring():
5 """Some unrelated info."""
6
7
8 def func_without_docstring():
9 pass
10
11
12 def func_with_doctest():
13 """
14 This function really contains a test case.
15
16 >>> func_with_doctest.__name__
17 'func_with_doctest'
18 """
19 return 3
20
21
22 class ESC[4;38;5;81mClassWithDocstring:
23 """Some unrelated class information."""
24
25
26 class ESC[4;38;5;81mClassWithoutDocstring:
27 pass
28
29
30 class ESC[4;38;5;81mClassWithDoctest:
31 """This class really has a test case in it.
32
33 >>> ClassWithDoctest.__name__
34 'ClassWithDoctest'
35 """
36
37
38 class ESC[4;38;5;81mMethodWrapper:
39 def method_with_docstring(self):
40 """Method with a docstring."""
41
42 def method_without_docstring(self):
43 pass
44
45 def method_with_doctest(self):
46 """
47 This has a doctest!
48 >>> MethodWrapper.method_with_doctest.__name__
49 'method_with_doctest'
50 """
51
52 # https://github.com/python/cpython/issues/99433
53 str_wrapper = object().__str__