def test_encoding_enum__error_multiple_variable_with_changing_enum(self):
        """
        Given 2 variables, if they share the same enum type,
        the 2 enum definition should be identical.
        """
        with create_tmp_file() as tmp_file:
            cloud_type_dict = {"clear": 0, "cloudy": 1, "missing": 255}
            with nc4.Dataset(tmp_file, mode="w") as nc:
                nc.createDimension("time", size=2)
                cloud_type = nc.createEnumType(np.uint8, "cloud_type", cloud_type_dict)
                nc.createVariable(
                    "clouds",
                    cloud_type,
                    "time",
                    fill_value=255,
                )
                nc.createVariable(
                    "tifa",
                    cloud_type,
                    "time",
                    fill_value=255,
                )
            with open_dataset(tmp_file) as original:
                assert (
                    original.clouds.encoding["dtype"].metadata
                    == original.tifa.encoding["dtype"].metadata
                )
                modified_enum = original.clouds.encoding["dtype"].metadata["enum"]
                modified_enum.update({"neblig": 2})
                original.clouds.encoding["dtype"] = np.dtype(
                    "u1",
                    metadata={"enum": modified_enum, "enum_name": "cloud_type"},
                )
                if not (self.engine == "h5netcdf" and not has_h5netcdf_1_4_0_or_above):
                    # not implemented yet in h5netcdf
                    with pytest.raises(
                        ValueError,
                        match=(
                            "Cannot save variable .*"
                            " because an enum `cloud_type` already exists in the Dataset .*"
                        ),
                    ):
                        with self.roundtrip(original):
                            pass

        Given 2 variables, if they share the same enum type,
        the 2 enum definition should be identical.
        
xarray/tests/test_backends.py