diff options
Diffstat (limited to 'Lib/test/test_operator.py')
| -rw-r--r-- | Lib/test/test_operator.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py index b9b8f15..cf3439f 100644 --- a/Lib/test/test_operator.py +++ b/Lib/test/test_operator.py @@ -518,6 +518,18 @@ class OperatorTestCase: with self.assertRaises(LookupError): operator.length_hint(X(LookupError)) + def test_call(self): + operator = self.module + + def func(*args, **kwargs): return args, kwargs + + self.assertEqual(operator.call(func), ((), {})) + self.assertEqual(operator.call(func, 0, 1), ((0, 1), {})) + self.assertEqual(operator.call(func, a=2, obj=3), + ((), {"a": 2, "obj": 3})) + self.assertEqual(operator.call(func, 0, 1, a=2, obj=3), + ((0, 1), {"a": 2, "obj": 3})) + def test_dunder_is_original(self): operator = self.module |
