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

Python code coverage for Lib/test/pydocfodder.py

#countcontent
1n/a"""Something just to look at via pydoc."""
2n/a
3n/aimport types
4n/a
5n/aclass A_classic:
6n/a "A classic class."
7n/a def A_method(self):
8n/a "Method defined in A."
9n/a def AB_method(self):
10n/a "Method defined in A and B."
11n/a def AC_method(self):
12n/a "Method defined in A and C."
13n/a def AD_method(self):
14n/a "Method defined in A and D."
15n/a def ABC_method(self):
16n/a "Method defined in A, B and C."
17n/a def ABD_method(self):
18n/a "Method defined in A, B and D."
19n/a def ACD_method(self):
20n/a "Method defined in A, C and D."
21n/a def ABCD_method(self):
22n/a "Method defined in A, B, C and D."
23n/a
24n/a
25n/aclass B_classic(A_classic):
26n/a "A classic class, derived from A_classic."
27n/a def AB_method(self):
28n/a "Method defined in A and B."
29n/a def ABC_method(self):
30n/a "Method defined in A, B and C."
31n/a def ABD_method(self):
32n/a "Method defined in A, B and D."
33n/a def ABCD_method(self):
34n/a "Method defined in A, B, C and D."
35n/a def B_method(self):
36n/a "Method defined in B."
37n/a def BC_method(self):
38n/a "Method defined in B and C."
39n/a def BD_method(self):
40n/a "Method defined in B and D."
41n/a def BCD_method(self):
42n/a "Method defined in B, C and D."
43n/a
44n/aclass C_classic(A_classic):
45n/a "A classic class, derived from A_classic."
46n/a def AC_method(self):
47n/a "Method defined in A and C."
48n/a def ABC_method(self):
49n/a "Method defined in A, B and C."
50n/a def ACD_method(self):
51n/a "Method defined in A, C and D."
52n/a def ABCD_method(self):
53n/a "Method defined in A, B, C and D."
54n/a def BC_method(self):
55n/a "Method defined in B and C."
56n/a def BCD_method(self):
57n/a "Method defined in B, C and D."
58n/a def C_method(self):
59n/a "Method defined in C."
60n/a def CD_method(self):
61n/a "Method defined in C and D."
62n/a
63n/aclass D_classic(B_classic, C_classic):
64n/a "A classic class, derived from B_classic and C_classic."
65n/a def AD_method(self):
66n/a "Method defined in A and D."
67n/a def ABD_method(self):
68n/a "Method defined in A, B and D."
69n/a def ACD_method(self):
70n/a "Method defined in A, C and D."
71n/a def ABCD_method(self):
72n/a "Method defined in A, B, C and D."
73n/a def BD_method(self):
74n/a "Method defined in B and D."
75n/a def BCD_method(self):
76n/a "Method defined in B, C and D."
77n/a def CD_method(self):
78n/a "Method defined in C and D."
79n/a def D_method(self):
80n/a "Method defined in D."
81n/a
82n/a
83n/aclass A_new(object):
84n/a "A new-style class."
85n/a
86n/a def A_method(self):
87n/a "Method defined in A."
88n/a def AB_method(self):
89n/a "Method defined in A and B."
90n/a def AC_method(self):
91n/a "Method defined in A and C."
92n/a def AD_method(self):
93n/a "Method defined in A and D."
94n/a def ABC_method(self):
95n/a "Method defined in A, B and C."
96n/a def ABD_method(self):
97n/a "Method defined in A, B and D."
98n/a def ACD_method(self):
99n/a "Method defined in A, C and D."
100n/a def ABCD_method(self):
101n/a "Method defined in A, B, C and D."
102n/a
103n/a def A_classmethod(cls, x):
104n/a "A class method defined in A."
105n/a A_classmethod = classmethod(A_classmethod)
106n/a
107n/a def A_staticmethod():
108n/a "A static method defined in A."
109n/a A_staticmethod = staticmethod(A_staticmethod)
110n/a
111n/a def _getx(self):
112n/a "A property getter function."
113n/a def _setx(self, value):
114n/a "A property setter function."
115n/a def _delx(self):
116n/a "A property deleter function."
117n/a A_property = property(fdel=_delx, fget=_getx, fset=_setx,
118n/a doc="A sample property defined in A.")
119n/a
120n/a A_int_alias = int
121n/a
122n/aclass B_new(A_new):
123n/a "A new-style class, derived from A_new."
124n/a
125n/a def AB_method(self):
126n/a "Method defined in A and B."
127n/a def ABC_method(self):
128n/a "Method defined in A, B and C."
129n/a def ABD_method(self):
130n/a "Method defined in A, B and D."
131n/a def ABCD_method(self):
132n/a "Method defined in A, B, C and D."
133n/a def B_method(self):
134n/a "Method defined in B."
135n/a def BC_method(self):
136n/a "Method defined in B and C."
137n/a def BD_method(self):
138n/a "Method defined in B and D."
139n/a def BCD_method(self):
140n/a "Method defined in B, C and D."
141n/a
142n/aclass C_new(A_new):
143n/a "A new-style class, derived from A_new."
144n/a
145n/a def AC_method(self):
146n/a "Method defined in A and C."
147n/a def ABC_method(self):
148n/a "Method defined in A, B and C."
149n/a def ACD_method(self):
150n/a "Method defined in A, C and D."
151n/a def ABCD_method(self):
152n/a "Method defined in A, B, C and D."
153n/a def BC_method(self):
154n/a "Method defined in B and C."
155n/a def BCD_method(self):
156n/a "Method defined in B, C and D."
157n/a def C_method(self):
158n/a "Method defined in C."
159n/a def CD_method(self):
160n/a "Method defined in C and D."
161n/a
162n/aclass D_new(B_new, C_new):
163n/a """A new-style class, derived from B_new and C_new.
164n/a """
165n/a
166n/a def AD_method(self):
167n/a "Method defined in A and D."
168n/a def ABD_method(self):
169n/a "Method defined in A, B and D."
170n/a def ACD_method(self):
171n/a "Method defined in A, C and D."
172n/a def ABCD_method(self):
173n/a "Method defined in A, B, C and D."
174n/a def BD_method(self):
175n/a "Method defined in B and D."
176n/a def BCD_method(self):
177n/a "Method defined in B, C and D."
178n/a def CD_method(self):
179n/a "Method defined in C and D."
180n/a def D_method(self):
181n/a "Method defined in D."
182n/a
183n/aclass FunkyProperties(object):
184n/a """From SF bug 472347, by Roeland Rengelink.
185n/a
186n/a Property getters etc may not be vanilla functions or methods,
187n/a and this used to make GUI pydoc blow up.
188n/a """
189n/a
190n/a def __init__(self):
191n/a self.desc = {'x':0}
192n/a
193n/a class get_desc:
194n/a def __init__(self, attr):
195n/a self.attr = attr
196n/a def __call__(self, inst):
197n/a print('Get called', self, inst)
198n/a return inst.desc[self.attr]
199n/a class set_desc:
200n/a def __init__(self, attr):
201n/a self.attr = attr
202n/a def __call__(self, inst, val):
203n/a print('Set called', self, inst, val)
204n/a inst.desc[self.attr] = val
205n/a class del_desc:
206n/a def __init__(self, attr):
207n/a self.attr = attr
208n/a def __call__(self, inst):
209n/a print('Del called', self, inst)
210n/a del inst.desc[self.attr]
211n/a
212n/a x = property(get_desc('x'), set_desc('x'), del_desc('x'), 'prop x')
213n/a
214n/a
215n/asubmodule = types.ModuleType(__name__ + '.submodule',
216n/a """A submodule, which should appear in its parent's summary""")