code: def test_invalid(test_images, tmp_path):
      fname2 = tmp_path / "stent.invalid.swf"
  
      # Empty file
      with open(fname2, "wb"):
          pass
      assert not iio.formats.search_read_format(
          core.Request(fname2, "rI")
      )
      with pytest.raises(RuntimeError):
          iio.mimread(fname2, "swf")
  
      # File with BS data
      with open(fname2, "wb") as f:
          f.write(b"x" * 100)
      assert not iio.formats.search_read_format(
          core.Request(fname2, "rI")
      )
      with pytest.raises(RuntimeError):
          iio.mimread(fname2, "swf")
  
file_path: imageio/tests/test_swf.py
imports: import numpy
  import pytest
  import imageio.v2
  import imageio.plugins
  from imageio import core
  from imageio.core import IS_PYPY
  from conftest import deprecated_test
label_desc: Use image node_id 5 for calling a global function with example usage: test_invalid(test_images, tmp_path) without return types