code: def test_series_unclosed(test_images, tmp_path):
      im1 = iio.imread(test_images / "chelsea.png")
      ims1 = [im1, im1 * 0.8, im1 * 0.5]
  
      fname = tmp_path / "chelseam.bsdf"
      w = iio.get_writer(fname)
      for im in ims1:
          w.append_data(im)
      w._close = lambda: None  # nope, leave stream open
      w.close()
  
      # read non-streaming, reads all frames on opening (but skips over blobs
      r = iio.get_reader(fname)
      assert r.get_length() == 3  # not np.inf because not streaming
  
      # read streaming and get all
      r = iio.get_reader(fname, random_access=False)
      assert r.get_length() == np.inf
      #
      ims2 = [im for im in r]
      assert len(ims2) == 3 and all(
          np.all(ims1[i] == ims2[i]) for i in range(3)
      )
  
      # read streaming and read one
      r = iio.get_reader(fname, random_access=False)
      assert r.get_length() == np.inf
      #
      assert np.all(ims1[2] == r.get_data(2))
  
file_path: imageio/tests/test_bsdf.py
imports: import numpy
  from pytest import raises
  from imageio import core
  import imageio.v2
  from imageio.plugins import _bsdf
  import pytest
  import sys
  from conftest import deprecated_test
label_desc: Use image node_id 5 for calling a global function with example usage: test_series_unclosed(test_images, tmp_path) without return types