Skip to content

Commit e1ef2e5

Browse files
committed
add test
1 parent 1a35f44 commit e1ef2e5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

nipype/utils/tests/test_config.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@
2727
vdisplay_num=2010)
2828

2929

30+
@pytest.mark.parametrize('disp_var', [':0', 'localhost:0', 'localhost:0.1'])
31+
def test_display_config_and_system(monkeypatch, disp_var):
32+
"""Check that when $DISPLAY is defined, the display is correctly parsed"""
33+
config._display = None
34+
dispstr = ':0'
35+
monkeypatch.setitem(os.environ, 'DISPLAY', disp_var)
36+
assert config.get_display() == dispstr
37+
# Test that it was correctly cached
38+
assert config.get_display() == dispstr
39+
40+
3041
@pytest.mark.parametrize('dispnum', range(5))
3142
def test_display_config(monkeypatch, dispnum):
3243
"""Check that the display_variable option is used ($DISPLAY not set)"""

0 commit comments

Comments
 (0)