def _teardown_session_environment(o: Session | Config, *variables: str):
    """Restore environment variable to original value."""
    for variable in variables:
        if hasattr(o, f"_original_{variable}"):
            os.environ[variable] = getattr(o, f"_original_{variable}")
        else:
            os.environ.pop(variable, None)
Restore environment variable to original value.
src/bentoml/testing/pytest/plugin.py