Make sure test_env_vars restores variables correctly

Otherwise, we'd get a segfault inside Qt in test_stylesheet, since
88f2873a79.
This commit is contained in:
Florian Bruhin 2018-06-10 15:49:24 +02:00
parent ca8d3903e3
commit 829a6855a3

View File

@ -302,7 +302,8 @@ class TestEarlyInit:
"""Check settings which set an environment variable.""" """Check settings which set an environment variable."""
monkeypatch.setattr(configinit.objects, 'backend', monkeypatch.setattr(configinit.objects, 'backend',
usertypes.Backend.QtWebEngine) usertypes.Backend.QtWebEngine)
monkeypatch.delenv(envvar, raising=False) monkeypatch.setenv(envvar, '') # to make sure it gets restored
monkeypatch.delenv(envvar)
config_stub.set_obj(config_opt, config_val) config_stub.set_obj(config_opt, config_val)
configinit._init_envvars() configinit._init_envvars()