def swe_env_context(env_args):
    """Context manager to make sure we close the shell on the container
    so that we can reuse it.
    """

    env = SWEEnv.from_config(env_args)
    env.start()
    try:
        yield env
    finally:
        env.close()
Context manager to make sure we close the shell on the container
    so that we can reuse it.
    
tests/conftest.py