def METHOD_NAME(self, mock):
    mock.configure_mock(**self.linear_dipole_attrs)
    # Replace with the refex version when Python2 is dropped.
    # with self.assertRaisesRegex(ValueError, 'masses'):
    with pytest.raises(ValueError):
        Moments(mock).calculate(origin='mass')