Skip to content

Commit 2383a5d

Browse files
committed
Fix tests on Python 3.12.4
Starting with Python 3.12.4, it is now possible to get a `signature()` of `partial()`. Update the test accordingly.
1 parent c1d189c commit 2383a5d

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

tests/test_partial_and_macros.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,12 @@ def f(a, b, c, **d):
161161
# it is possible to keyword-partialize a positional-only argument...
162162
fp_ref = functools.partial(f, b=0)
163163

164-
# but 'signature' does not support it !
165-
with pytest.raises(ValueError):
166-
signature(fp_ref)
167-
168-
# assert str(signature(fp_ref)) == "(c, /, *, d, **e)"
164+
# but 'signature' does not support it before Python 3.12.4 !
165+
if sys.version_info < (3, 12, 4):
166+
with pytest.raises(ValueError):
167+
signature(fp_ref)
168+
else:
169+
assert str(signature(fp_ref)) == "(a, c, /, *, d, **e)"
169170

170171
# so we do not support it
171172
with pytest.raises(NotImplementedError):

0 commit comments

Comments
 (0)