try:
    yield
finally:
    print('exiting')

def test():
    with context():
        for x in range(10):
            yield x
for x in test():
    if x == 5:
        break
Is there a meaningful way to use context managers inside generators?