code: def test_display_noconfig_nosystem_patched(monkeypatch):
      """Check that when no $DISPLAY nor option are specified, a virtual Xvfb is
      used"""
      config._display = None
      if config.has_option("execution", "display_variable"):
          config._config.remove_option("execution", "display_variable")
      monkeypatch.delitem(os.environ, "DISPLAY", raising=False)
      monkeypatch.setitem(sys.modules, "xvfbwrapper", xvfbpatch)
      monkeypatch.setattr(sys, "platform", value="linux")
      assert config.get_display() == ":2010"
      # Test that it was correctly cached
      assert config.get_display() == ":2010"
  
      # Check that raises in Mac
      config._display = None
      monkeypatch.setattr(sys, "platform", value="darwin")
      with pytest.raises(RuntimeError):
          config.get_display()
  
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 5 for calling a global function with example usage: test_display_noconfig_nosystem_patched(monkeypatch) without return types