code: def test_allow_unsupported_drivers(monkeypatch):
      """Test if allow unsupported drivers works as expected"""
  
      # We delete a known working driver from fiona.drvsupport so that we can use it
      monkeypatch.delitem(fiona.drvsupport.supported_drivers, "GPKG")
  
      schema = {"geometry": "Polygon", "properties": {}}
  
      # Test that indeed we can't create a file without allow_unsupported_drivers
      with pytest.raises(DriverError):
          with MemoryFile() as memfile:
              with memfile.open(mode="w", driver="GPKG", schema=schema):
                  pass
  
      # Test that we can create file with allow_unsupported_drivers=True
      try:
          with MemoryFile() as memfile:
              with memfile.open(
                  mode="w",
                  driver="GPKG",
                  schema=schema,
                  allow_unsupported_drivers=True,
              ):
                  pass
      except Exception as e:
          assert (
              False
          ), f"Using allow_unsupported_drivers=True should not raise an exception: {e}"
  
imports: import os
  from io import BytesIO
  import pytest
  import fiona
  from fiona import supported_drivers
  from fiona.drvsupport import _driver_supports_mode
  from fiona.errors import DriverError
  from fiona.io import MemoryFile, ZipMemoryFile
  from fiona.meta import supports_vsi
  from .conftest import requires_gdal2, requires_gpkg
label_desc: Use image node_id 29 for calling a global function with example usage: test_allow_unsupported_drivers(monkeypatch) without return types