code: def test_display_config_and_system(monkeypatch):
      """Check that when only both config and $DISPLAY are defined, the config
      takes precedence"""
      config._display = None
      dispstr = ":10"
      config.set("execution", "display_variable", dispstr)
      monkeypatch.setenv("DISPLAY", ":0")
      assert config.get_display() == dispstr
      # Test that it was correctly cached
      assert config.get_display() == dispstr
  
file_path: nipype/nipype/utils/tests/test_config.py
imports: import os
  import sys
  import pytest
  from nipype import config
  from unittest.mock import MagicMock
label_desc: Use image node_id 4 for calling a global function with example usage: test_display_config_and_system(monkeypatch) without return types