def METHOD_NAME(self):
    # Modify the builtins out from under a live generator.
    def foo():
        x = range(3)
        yield len(x)
        yield len(x)
    self.configure_func(foo)
    g = foo()
    self.assertEqual(next(g), 3)
    with swap_attr(builtins, "len", lambda x: 7):
        self.assertEqual(next(g), 7)