code: def test_basic_reading(test_images, tmp_path):
      img_expected = iio.imread(test_images / "chelsea.png")
      img = iio.imread(test_images / "chelsea.png", plugin="opencv")
      assert img.shape == (300, 451, 3)
      assert np.allclose(img, img_expected)
  
      img = iio.imread(
          test_images / "chelsea.png",
          plugin="opencv",
          colorspace=cv2.COLOR_BGR2RGBA,
      )
      img2 = iio.imread(
          test_images / "chelsea.png",
          plugin="opencv",
          colorspace="RGBA",
      )
      assert img.shape == (300, 451, 4)
      assert np.allclose(img, img2)
  
      img_expected = iio.imread(test_images / "camera.png")
      img = iio.imread(
          test_images / "camera.png",
          plugin="opencv",
          flags=cv2.IMREAD_ANYCOLOR,
      )
      assert img.shape == (512, 512)
      assert np.allclose(img, img_expected)
  
      img_expected = iio.imread(
          test_images / "astronaut.png", mode="RGBA"
      )
      iio.imwrite(tmp_path / "test.png", img_expected)
      img = iio.imread(
          tmp_path / "test.png",
          plugin="opencv",
          flags=cv2.IMREAD_UNCHANGED,
      )
      assert img.shape == (512, 512, 4)
      assert np.allclose(img, img_expected)
  
      with pytest.raises(IOError):
          iio.imread("nonexistant.png", plugin="opencv")
  
file_path: imageio/tests/test_opencv.py
imports: import warnings
  import imageio.v3
  import numpy
  import pytest
  import cv2
label_desc: Use image node_id 1 for calling a global function with example usage: test_basic_reading(test_images, tmp_path) without return types