(self)
| 566 | self.assertEqual(repr(g_partial),"functools.partial(Function(old_function), EvilObject, None, None, None, None, arg=None)") |
| 567 | |
| 568 | def test_str_subclass_error(self): |
| 569 | class BadStr(str): |
| 570 | def __eq__(self, other): |
| 571 | raise RuntimeError |
| 572 | def __hash__(self): |
| 573 | return str.__hash__(self) |
| 574 | |
| 575 | def f(**kwargs): |
| 576 | return kwargs |
| 577 | |
| 578 | p = functools.partial(f, poison="") |
| 579 | with self.assertRaises(RuntimeError): |
| 580 | result = p(**{BadStr("poison"): "new_value"}) |
| 581 | |
| 582 | @unittest.skipUnless(c_functools, 'requires the C _functools module') |
| 583 | class TestPartialC(TestPartial, unittest.TestCase): |
nothing calls this directly
no test coverage detected