From 829a6855a35d015bee75f8e449f6b2c58ea4210c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 10 Jun 2018 15:49:24 +0200 Subject: [PATCH] Make sure test_env_vars restores variables correctly Otherwise, we'd get a segfault inside Qt in test_stylesheet, since 88f2873a790b576afa11dc2fc8fa6f568a84e589. --- tests/unit/config/test_configinit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/config/test_configinit.py b/tests/unit/config/test_configinit.py index aa7cde981..e727c3da5 100644 --- a/tests/unit/config/test_configinit.py +++ b/tests/unit/config/test_configinit.py @@ -302,7 +302,8 @@ class TestEarlyInit: """Check settings which set an environment variable.""" monkeypatch.setattr(configinit.objects, 'backend', 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) configinit._init_envvars()