code: def test_alert_future_error():
      with pytest.warns(FutureWarning):
          alert_future_error(
              "Message",
              "9999.9.9",
              warning_rec="Silence this warning by doing XYZ.",
              error_rec="Fix this issue by doing XYZ.",
          )
      with pytest.raises(RuntimeError):
          alert_future_error(
              "Message",
              "1.0.0",
              warning_rec="Silence this warning by doing XYZ.",
              error_rec="Fix this issue by doing XYZ.",
          )
      with pytest.raises(ValueError):
          alert_future_error(
              "Message",
              "1.0.0",
              warning_rec="Silence this warning by doing XYZ.",
              error_rec="Fix this issue by doing XYZ.",
              error_class=ValueError,
          )
      with pytest.raises(ValueError):
          alert_future_error(
              "Message",
              "2.0.0",  # Error if we equal the (patched) version
              warning_rec="Silence this warning by doing XYZ.",
              error_rec="Fix this issue by doing XYZ.",
              error_class=ValueError,
          )
  
file_path: nibabel/nibabel/tests/test_deprecated.py
imports: import warnings
  import pytest
  from nibabel import pkg_info
  from nibabel.deprecated import FutureWarningMixin, ModuleProxy, alert_future_error, deprecate_with_version
  from nibabel.tests.test_deprecator import TestDeprecatorFunc
label_desc: Use image node_id 6 for calling a global function with example usage: test_alert_future_error() without return types