ยปCore Development>Code coverage>Lib/test/inspect_fodder2.py

Python code coverage for Lib/test/inspect_fodder2.py

#countcontent
1n/a# line 1
2n/adef wrap(foo=None):
3n/a def wrapper(func):
4n/a return func
5n/a return wrapper
6n/a
7n/a# line 7
8n/adef replace(func):
9n/a def insteadfunc():
10n/a print('hello')
11n/a return insteadfunc
12n/a
13n/a# line 13
14n/a@wrap()
15n/a@wrap(wrap)
16n/adef wrapped():
17n/a pass
18n/a
19n/a# line 19
20n/a@replace
21n/adef gone():
22n/a pass
23n/a
24n/a# line 24
25n/aoll = lambda m: m
26n/a
27n/a# line 27
28n/atll = lambda g: g and \
29n/ag and \
30n/ag
31n/a
32n/a# line 32
33n/atlli = lambda d: d and \
34n/a d
35n/a
36n/a# line 36
37n/adef onelinefunc(): pass
38n/a
39n/a# line 39
40n/adef manyargs(arg1, arg2,
41n/aarg3, arg4): pass
42n/a
43n/a# line 43
44n/adef twolinefunc(m): return m and \
45n/am
46n/a
47n/a# line 47
48n/aa = [None,
49n/a lambda x: x,
50n/a None]
51n/a
52n/a# line 52
53n/adef setfunc(func):
54n/a globals()["anonymous"] = func
55n/asetfunc(lambda x, y: x*y)
56n/a
57n/a# line 57
58n/adef with_comment(): # hello
59n/a world
60n/a
61n/a# line 61
62n/amultiline_sig = [
63n/a lambda x, \
64n/a y: x+y,
65n/a None,
66n/a ]
67n/a
68n/a# line 68
69n/adef func69():
70n/a class cls70:
71n/a def func71():
72n/a pass
73n/a return cls70
74n/aextra74 = 74
75n/a
76n/a# line 76
77n/adef func77(): pass
78n/a(extra78, stuff78) = 'xy'
79n/aextra79 = 'stop'
80n/a
81n/a# line 81
82n/aclass cls82:
83n/a def func83(): pass
84n/a(extra84, stuff84) = 'xy'
85n/aextra85 = 'stop'
86n/a
87n/a# line 87
88n/adef func88():
89n/a # comment
90n/a return 90
91n/a
92n/a# line 92
93n/adef f():
94n/a class X:
95n/a def g():
96n/a "doc"
97n/a return 42
98n/a return X
99n/amethod_in_dynamic_class = f().g
100n/a
101n/a#line 101
102n/adef keyworded(*arg1, arg2=1):
103n/a pass
104n/a
105n/a#line 105
106n/adef annotated(arg1: list):
107n/a pass
108n/a
109n/a#line 109
110n/adef keyword_only_arg(*, arg):
111n/a pass
112n/a
113n/a@wrap(lambda: None)
114n/adef func114():
115n/a return 115
116n/a
117n/aclass ClassWithMethod:
118n/a def method(self):
119n/a pass
120n/a
121n/afrom functools import wraps
122n/a
123n/adef decorator(func):
124n/a @wraps(func)
125n/a def fake():
126n/a return 42
127n/a return fake
128n/a
129n/a#line 129
130n/a@decorator
131n/adef real():
132n/a return 20
133n/a
134n/a#line 134
135n/aclass cls135:
136n/a def func136():
137n/a def func137():
138n/a never_reached1
139n/a never_reached2