code: def test_writing(test_images, tmp_path):
      img_expected = iio.imread(test_images / "chelsea.png")
      iio.imwrite(tmp_path / "test.png", img_expected, plugin="opencv")
      result = iio.imread(tmp_path / "test.png")
      np.allclose(result, img_expected)
  
      img_expected = iio.imread(
          test_images / "chelsea.png", mode="RGBA"
      )
      iio.imwrite(tmp_path / "test.png", img_expected, plugin="opencv")
      result = iio.imread(tmp_path / "test.png")
      np.allclose(result, img_expected)
  
      img_expected = iio.imread(test_images / "camera.png")
      iio.imwrite(tmp_path / "test.png", img_expected, plugin="opencv")
      result = iio.imread(tmp_path / "test.png")
      np.allclose(result, img_expected)
  
      img_expected = iio.imread(test_images / "camera.png")
      with pytest.raises(IOError):
          iio.imwrite("no_extension", img_expected, 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 5 for calling a global function with example usage: test_writing(test_images, tmp_path) without return types