We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4dc5896 commit 5de504aCopy full SHA for 5de504a
nipype/utils/tests/test_config.py
@@ -32,10 +32,15 @@ def test_display_parse(monkeypatch, disp_var):
32
"""Check that when $DISPLAY is defined, the display is correctly parsed"""
33
config._display = None
34
dispstr = ':0'
35
- monkeypatch.setenv('DISPLAY', disp_var)
+ old_disp = os.getenv('DISPLAY')
36
+ os.environ['DISPLAY'] = disp_var
37
assert config.get_display() == dispstr
38
# Test that it was correctly cached
39
40
+ if old_disp is not None:
41
+ os.environ['DISPLAY'] = old_disp
42
+ else:
43
+ del os.environ['DISPLAY']
44
45
46
@pytest.mark.parametrize('dispnum', range(5))
0 commit comments