(self)
| 37 | self.assertEqual(foo(), 7) |
| 38 | |
| 39 | def test_modify_builtins(self): |
| 40 | # Modify the builtins module directly. |
| 41 | def foo(): |
| 42 | return len([1, 2, 3]) |
| 43 | self.configure_func(foo) |
| 44 | |
| 45 | self.assertEqual(foo(), 3) |
| 46 | with swap_attr(builtins, "len", lambda x: 7): |
| 47 | self.assertEqual(foo(), 7) |
| 48 | |
| 49 | def test_modify_builtins_while_generator_active(self): |
| 50 | # Modify the builtins out from under a live generator. |
nothing calls this directly
no test coverage detected