Skip to content

Commit 3c4edd8

Browse files
committed
test fixes
1 parent 9262323 commit 3c4edd8

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

Lib/inspect.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2437,7 +2437,6 @@ def _signature_from_callable(obj, *,
24372437
return sig
24382438

24392439
if isinstance(obj, functools.partial):
2440-
print('HERE?', obj)
24412440
wrapped_sig = _get_signature_of(obj.func)
24422441
return _signature_get_partial(wrapped_sig, obj)
24432442

Lib/test/test_functools.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,6 @@ class PartialMethodSubclass(functools.partialmethod):
718718
p = functools.partialmethod(min, 2)
719719
p2 = PartialMethodSubclass(p, 1)
720720
self.assertIs(p2.func, min)
721-
print(p2.__get__(0)())
722721
self.assertEqual(p2.__get__(0)(), 0)
723722
# `partialmethod` subclass input to `partialmethod` subclass
724723
p = PartialMethodSubclass(min, 2)

Lib/test/test_inspect/test_inspect.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3606,6 +3606,16 @@ def foo(a=0, b=1, /, c=2, d=3):
36063606
def test_signature_on_partialmethod(self):
36073607
from functools import partialmethod
36083608

3609+
class Spam:
3610+
def test():
3611+
pass
3612+
ham = partialmethod(test)
3613+
3614+
self.assertEqual(self.signature(Spam.ham, eval_str=False),
3615+
((), Ellipsis))
3616+
with self.assertRaisesRegex(ValueError, "invalid method signature"):
3617+
inspect.signature(Spam().ham)
3618+
36093619
class Spam:
36103620
def test(it, a, b, *, c) -> 'spam':
36113621
pass

0 commit comments

Comments
 (0)