code: def test_allow_unsupported_drivers(monkeypatch, tmpdir):
      """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
      path1 = str(tmpdir.join("test1.gpkg"))
      with pytest.raises(DriverError):
          with fiona.open(
              path1, mode="w", driver="GPKG", schema=schema
          ):
              pass
  
      # Test that we can create file with allow_unsupported_drivers=True
      path2 = str(tmpdir.join("test2.gpkg"))
      try:
          with fiona.open(
              path2,
              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}"
  
file_path: Fiona/tests/test_drvsupport.py
imports: import logging
  import pytest
  from .conftest import requires_gdal24, get_temp_filename
  from fiona.drvsupport import supported_drivers, driver_mode_mingdal
  import fiona.drvsupport
  from fiona.env import GDALVersion
  from fiona._env import calc_gdal_version_num, get_gdal_version_num
  from fiona.errors import DriverError
label_desc: Use image node_id 9 for calling a global function with example usage: test_allow_unsupported_drivers(monkeypatch, tmpdir) without return types