Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
PyPy
pypy
Commits
21401ebc2df3
Commit
124cc4b3
authored
Dec 03, 2022
by
Matti Picus
Browse files
fix tests for no c_functools
--HG-- branch : release-pypy3.9-v7.x
parent
779dbcf66803
Pipeline
#59199
passed with stage
in 9 minutes and 17 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
lib-python/3/test/test_functools.py
View file @
21401ebc
...
...
@@ -199,7 +199,9 @@ class TestPartial:
kwargs
=
{
'a'
:
object
(),
'b'
:
object
()}
kwargs_reprs
=
[
'a={a!r}, b={b!r}'
.
format_map
(
kwargs
),
'b={b!r}, a={a!r}'
.
format_map
(
kwargs
)]
if
self
.
partial
in
(
c_functools
.
partial
,
py_functools
.
partial
):
if
c_functools
and
self
.
partial
is
c_functools
.
partial
:
name
=
'functools.partial'
elif
self
.
partial
is
py_functools
.
partial
:
name
=
'functools.partial'
else
:
name
=
self
.
partial
.
__name__
...
...
@@ -221,7 +223,9 @@ class TestPartial:
for
kwargs_repr
in
kwargs_reprs
])
def
test_recursive_repr
(
self
):
if
self
.
partial
in
(
c_functools
.
partial
,
py_functools
.
partial
):
if
c_functools
and
self
.
partial
is
c_functools
.
partial
:
name
=
'functools.partial'
elif
self
.
partial
is
py_functools
.
partial
:
name
=
'functools.partial'
else
:
name
=
self
.
partial
.
__name__
...
...
@@ -1753,9 +1757,10 @@ class TestLRU:
def
py_cached_func
(
x
,
y
):
return
3
*
x
+
y
@
c_functools
.
lru_cache
()
def
c_cached_func
(
x
,
y
):
return
3
*
x
+
y
if
c_functools
:
@
c_functools
.
lru_cache
()
def
c_cached_func
(
x
,
y
):
return
3
*
x
+
y
class
TestLRUPy
(
TestLRU
,
unittest
.
TestCase
):
...
...
@@ -1772,18 +1777,20 @@ class TestLRUPy(TestLRU, unittest.TestCase):
return
3
*
x
+
y
class
TestLRUC
(
TestLRU
,
unittest
.
TestCase
):
module
=
c_functools
cached_func
=
c_cached_func
,
if
c_functools
:
@
unittest
.
skipUnless
(
c_functools
,
'requires the C _functools module'
)
class
TestLRUC
(
TestLRU
,
unittest
.
TestCase
):
module
=
c_functools
cached_func
=
c_cached_func
,
@
module
.
lru_cache
()
def
cached_meth
(
self
,
x
,
y
):
return
3
*
x
+
y
@
module
.
lru_cache
()
def
cached_meth
(
self
,
x
,
y
):
return
3
*
x
+
y
@
staticmethod
@
module
.
lru_cache
()
def
cached_staticmeth
(
x
,
y
):
return
3
*
x
+
y
@
staticmethod
@
module
.
lru_cache
()
def
cached_staticmeth
(
x
,
y
):
return
3
*
x
+
y
class
TestSingleDispatch
(
unittest
.
TestCase
):
...
...
Matti Picus
@mattip
mentioned in commit
146f50178899
·
Dec 06, 2022
mentioned in commit
146f50178899
mentioned in commit d37bd6d12dfb8a52e895aa37723001f08fff3e13
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment