@@ -3050,14 +3050,21 @@ def test_signature_from_callable_python_obj(self): |
|
|
3050 |
3050 |
class MySignature(inspect.Signature): pass |
3051 |
3051 |
def foo(a, *, b:1): pass |
3052 |
3052 |
foo_sig = MySignature.from_callable(foo) |
3053 |
|
-self.assertTrue(isinstance(foo_sig, MySignature)) |
|
3053 |
+self.assertIsInstance(foo_sig, MySignature) |
|
3054 |
+ |
|
3055 |
+def test_signature_from_callable_class(self): |
|
3056 |
+# A regression test for a class inheriting its signature from `object`. |
|
3057 |
+class MySignature(inspect.Signature): pass |
|
3058 |
+class foo: pass |
|
3059 |
+foo_sig = MySignature.from_callable(foo) |
|
3060 |
+self.assertIsInstance(foo_sig, MySignature) |
3054 |
3061 |
|
3055 |
3062 |
@unittest.skipIf(MISSING_C_DOCSTRINGS, |
3056 |
3063 |
"Signature information for builtins requires docstrings") |
3057 |
3064 |
def test_signature_from_callable_builtin_obj(self): |
3058 |
3065 |
class MySignature(inspect.Signature): pass |
3059 |
3066 |
sig = MySignature.from_callable(_pickle.Pickler) |
3060 |
|
-self.assertTrue(isinstance(sig, MySignature)) |
|
3067 |
+self.assertIsInstance(sig, MySignature) |
3061 |
3068 |
|
3062 |
3069 |
def test_signature_definition_order_preserved_on_kwonly(self): |
3063 |
3070 |
for fn in signatures_with_lexicographic_keyword_only_parameters(): |