code: def test_clear_and_catch_warnings_inherit():
      # Test can subclass and add default modules
      my_mod = get_fresh_mod(__name__)
      with my_cacw():
          warnings.simplefilter("ignore")
          warnings.warn("Some warning")
      assert my_mod.__warningregistry__ == {}
  
file_path: nibabel/nibabel/tests/test_testing.py
imports: import os
  import sys
  import warnings
  import numpy
  import pytest
  from ..casting import sctypes
  from ..testing import assert_allclose_safely, assert_re_in, clear_and_catch_warnings, data_path, error_warnings, get_fresh_mod, get_test_data, suppress_warnings
label_desc: Use image node_id 4 for calling a global function with example usage: test_clear_and_catch_warnings_inherit() without return types