code: def tmpconfig(request):
      
      SUBFOLDER = tempfile.mkdtemp()
      CONF = UserConfig('spyder-test',
                        defaults=DEFAULTS,
                        version=CONF_VERSION,
                        subfolder=SUBFOLDER,
                        raw_mode=True,
                        )
  
      def fin():
          """
          Fixture finalizer to delete the temporary CONF element.
          """
          shutil.rmtree(SUBFOLDER)
  
      request.addfinalizer(fin)
      return CONF
docs: Fixtures that returns a temporary CONF element.