Note

You are not reading the stable version of Gammapy documentation.
Access the latest stable version v1.3 or the list of Gammapy releases.

assert_quantity_allclose

gammapy.utils.testing.assert_quantity_allclose(actual, desired, rtol=1e-07, atol=None, **kwargs)[source]

Assert all-close for astropy.units.Quantity objects.

Requires that unit is identical, not just that quantities are allclose taking different units into account.

We prefer this kind of assert for testing, since units should only change on purpose, so this tests more behaviour.