code: def test_fetch_neurovault_errors(capsys, request_mocker):
      """Test that errors are logged when the server returns an error code.
  
      May "spam" your standard output with requests exceptions,
      but that's expected.
      """
      request_mocker.url_mapping["*"] = 500
      data = neurovault.fetch_neurovault()
  
      captured = capsys.readouterr()
      match = re.search("500 Error", captured.err)
      assert match is not None
  
      assert len(data.images) == 0
  
imports: import hashlib
  import json
  import os
  import re
  import stat
  from urllib import parse
  import numpy
  import pandas
  import pytest
  import requests
  from nilearn._utils.data_gen import generate_fake_fmri
  from nilearn.conftest import _rng
  from nilearn.datasets import neurovault
  from nilearn.image import load_img
label_desc: Use image node_id 41 for calling a global function with example usage: test_fetch_neurovault_errors(capsys, request_mocker) without return types