code: def test_version(tmp_path):
      out = str(tmp_path / "temp.gif")
  
      def assertVersionAfterSave(im, version):
          im.save(out)
          with Image.open(out) as reread:
              assert reread.info["version"] == version
  
      # Test that GIF87a is used by default
      im = Image.new("L", (100, 100), "#000")
      assertVersionAfterSave(im, b"GIF87a")
  
      # Test setting the version to 89a
      im = Image.new("L", (100, 100), "#000")
      im.info["version"] = b"89a"
      assertVersionAfterSave(im, b"GIF89a")
  
      # Test that adding a GIF89a feature changes the version
      im.info["transparency"] = 1
      assertVersionAfterSave(im, b"GIF89a")
  
      # Test that a GIF87a image is also saved in that format
      with Image.open("Tests/images/test.colors.gif") as im:
          assertVersionAfterSave(im, b"GIF87a")
  
          # Test that a GIF89a image is also saved in that format
          im.info["version"] = b"GIF89a"
          assertVersionAfterSave(im, b"GIF87a")
  
imports: from io import BytesIO
  import pytest
  from PIL import GifImagePlugin, Image, ImageDraw, ImagePalette, features
  from .helper import assert_image_equal, assert_image_equal_tofile, assert_image_similar, hopper, is_pypy, netpbm_available
label_desc: Use image node_id 47 for calling a global function with example usage: test_version(tmp_path) without return types