Commit d89dce9
committed
Skip CPython specific descriptor tests on PyPy.
PyPy does not ship the ``_pickle`` C module used to obtain a C extension
backed slot wrapper, so import of the descriptor tests fails at
collection time on PyPy. Beyond the missing module, the native CPython
descriptor types exercised here (wrapper_descriptor, method_descriptor,
classmethod_descriptor, getset_descriptor, member_descriptor) are CPython
implementation details which PyPy does not expose as the same distinct
types. The regression these tests guard against is also specific to the
wrapt C extension which is not built on PyPy.
Detect PyPy via ``platform.python_implementation()`` and skip the test
classes covering native CPython descriptors and the two subclass
attribute access tests which wrap a native slot wrapper. The Python
level descriptor tests (property, classmethod, staticmethod, custom
user defined descriptor, plain Python method) continue to run on PyPy.
Guard the ``_pickle`` import behind the same flag so the module loads
on PyPy in the first place.1 parent 86f4e0e commit d89dce9
1 file changed
Lines changed: 28 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
29 | 48 | | |
30 | 49 | | |
31 | 50 | | |
| |||
44 | 63 | | |
45 | 64 | | |
46 | 65 | | |
| 66 | + | |
47 | 67 | | |
48 | 68 | | |
49 | 69 | | |
| |||
71 | 91 | | |
72 | 92 | | |
73 | 93 | | |
| 94 | + | |
74 | 95 | | |
75 | 96 | | |
76 | 97 | | |
| |||
94 | 115 | | |
95 | 116 | | |
96 | 117 | | |
| 118 | + | |
97 | 119 | | |
98 | 120 | | |
99 | 121 | | |
| |||
106 | 128 | | |
107 | 129 | | |
108 | 130 | | |
| 131 | + | |
109 | 132 | | |
110 | 133 | | |
111 | 134 | | |
| |||
131 | 154 | | |
132 | 155 | | |
133 | 156 | | |
| 157 | + | |
134 | 158 | | |
135 | 159 | | |
136 | 160 | | |
| |||
230 | 254 | | |
231 | 255 | | |
232 | 256 | | |
| 257 | + | |
233 | 258 | | |
234 | 259 | | |
235 | 260 | | |
| |||
238 | 263 | | |
239 | 264 | | |
240 | 265 | | |
| 266 | + | |
241 | 267 | | |
242 | 268 | | |
243 | 269 | | |
| |||
0 commit comments