Repository navigation
Expand file tree
/
Copy pathcopytests.patch
More file actions
73 lines (59 loc) · 2.43 KB
/
Copy pathcopytests.patch
File metadata and controls
73 lines (59 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
--- a/cytoolz/tests/test_functoolz.py
+++ b/cytoolz/tests/test_functoolz.py
@@ -11,7 +11,13 @@
from cytoolz.utils import raises
from functools import partial
+IS_PYPY_GE_39 = (
+ sys.implementation.name == "pypy"
+ and sys.version_info.major == 3
+ and sys.version_info.minor >= 9
+)
+
def iseven(x):
return x % 2 == 0
@@ -257,7 +263,8 @@
return x
g = curry(f)
- assert g.__doc__ == f.__doc__
+ if not IS_PYPY_GE_39: # pypy >=3.9 doesn't like __doc__ property
+ assert g.__doc__ == f.__doc__
assert str(g) == str(f)
assert f(1, 2) == g(1, 2)
@@ -586,14 +593,16 @@
composed = compose(f, g)
assert composed.__name__ == 'f_of_g'
- assert composed.__doc__ == 'lambda *args, **kwargs: f(g(*args, **kwargs))'
+ if not IS_PYPY_GE_39: # pypy >=3.9 doesn't like __doc__ property
+ assert composed.__doc__ == 'lambda *args, **kwargs: f(g(*args, **kwargs))'
# Create an object with no __name__.
h = object()
composed = compose(f, h)
assert composed.__name__ == 'Compose'
- assert composed.__doc__ == 'A composition of functions'
+ if not IS_PYPY_GE_39: # pypy >=3.9 doesn't like __doc__ property
+ assert composed.__doc__ == 'A composition of functions'
assert repr(composed) == f'Compose({f!r}, {h!r})'
@@ -889,9 +898,10 @@
assert excepting(3) == -1
assert excepting.__name__ == 'idx_excepting_ValueError'
- assert 'idx docstring' in excepting.__doc__
- assert 'ValueError' in excepting.__doc__
- assert 'handler docstring' in excepting.__doc__
+ if not IS_PYPY_GE_39: # pypy >=3.9 doesn't like __doc__ property
+ assert 'idx docstring' in excepting.__doc__
+ assert 'ValueError' in excepting.__doc__
+ assert 'handler docstring' in excepting.__doc__
def getzero(a):
"""getzero docstring
@@ -905,9 +915,10 @@
assert excepting({0: 1}) == 1
assert excepting.__name__ == 'getzero_excepting_IndexError_or_KeyError'
- assert 'getzero docstring' in excepting.__doc__
- assert 'return_none' in excepting.__doc__
- assert 'Returns None' in excepting.__doc__
+ if not IS_PYPY_GE_39: # pypy >=3.9 doesn't like __doc__ property
+ assert 'getzero docstring' in excepting.__doc__
+ assert 'return_none' in excepting.__doc__
+ assert 'Returns None' in excepting.__doc__
def raise_(a):
"""A function that raises an instance of the exception type given.