class resources:

    def __init__(self):
        self.data = 'at-init'

def __enter__(self):
    self.data = 'at-enter'
return self

def __exit__(self, exc_type, exc_val, exc_tb):
    pass
Unittest for context-manager fails with AttributeError: __exit__