(self)
| 27 | pass |
| 28 | |
| 29 | def test_globals_shadow_builtins(self): |
| 30 | # Modify globals() to shadow an entry in builtins. |
| 31 | def foo(): |
| 32 | return len([1, 2, 3]) |
| 33 | self.configure_func(foo) |
| 34 | |
| 35 | self.assertEqual(foo(), 3) |
| 36 | with swap_item(globals(), "len", lambda x: 7): |
| 37 | self.assertEqual(foo(), 7) |
| 38 | |
| 39 | def test_modify_builtins(self): |
| 40 | # Modify the builtins module directly. |
nothing calls this directly
no test coverage detected