# xarray.testing.assert_identical

### xarray.testing.assert_identical(a, b)[[source]](https://github.com/pydata/xarray/blob/main/xarray/testing/assertions.py#L166-L206)

Like [`xarray.testing.assert_equal()`](xarray.testing.assert_equal.html.md#xarray.testing.assert_equal), but also matches the
objects’ names and attributes.

Raises an AssertionError if two objects are not identical.

For DataTree objects, assert_identical is mapped over all Datasets on each
node, with the DataTrees being identical if both are isomorphic and the
corresponding Datasets at each node are themselves identical.

* **Parameters:**
  * **a** ([`xarray.Dataset`](xarray.Dataset.html.md#xarray.Dataset), [`xarray.DataArray`](xarray.DataArray.html.md#xarray.DataArray), [`xarray.Variable`](xarray.Variable.html.md#xarray.Variable) or [`xarray.Coordinates`](xarray.Coordinates.html.md#xarray.Coordinates)) – The first object to compare.
  * **b** ([`xarray.Dataset`](xarray.Dataset.html.md#xarray.Dataset), [`xarray.DataArray`](xarray.DataArray.html.md#xarray.DataArray), [`xarray.Variable`](xarray.Variable.html.md#xarray.Variable) or [`xarray.Coordinates`](xarray.Coordinates.html.md#xarray.Coordinates)) – The second object to compare.

#### SEE ALSO
[`assert_equal`](xarray.testing.assert_equal.html.md#xarray.testing.assert_equal), [`assert_allclose`](xarray.testing.assert_allclose.html.md#xarray.testing.assert_allclose), `Dataset.equals`, `DataArray.equals`
