Instead of directly changing the environment, pytest can also do this via monkeypatching: https://docs.pytest.org/en/latest/how-to/monkeypatch.html#monkeypatching-environment-variables We should do that because it ensures a known test environment.