scipp.testing.assertions.assert_identical#

scipp.testing.assertions.assert_identical(a, b)#

Raise an AssertionError if two objects are not identical.

For Scipp objects, assert_identical(a, b) is equivalent to assert sc.identical(a, b, equal_nan=True) but produces a more precise error message in pytest. If this function is called with arguments that are not supported by scipp.identical(), it calls assert a == b.

This function requires exact equality including equal types. For example, assert_identical(1, 1.0) will raise.

NaN elements of Scipp variables are treated as equal.

Parameters
  • a (TypeVar(T)) – The actual object to check.

  • b (TypeVar(T)) – The desired, expected object.

Raises

AssertionError – If the objects are not identical.

Return type

None