'Check that addition/subtraction with quantities with magnitude or
MagUnit units works, and that it changes the physical units
appropriately.'

@pytest.mark.parametrize(u'other', ((1.23 * u.mag), (2.34 * u.mag()), u.Magnitude((3.45 * u.Jy)), u.Magnitude((4.56 * u.m)), (5.67 * u.Unit((2 * u.mag))), u.Magnitude(6.78, (2.0 * u.mag))))
def test_addition_subtraction(self, other):

    lq = u.Magnitude((np.arange(1.0, 10.0) * u.Jy))
    other_physical = other.to(getattr(other.unit, u'physical_unit', u.dimensionless_unscaled), equivalencies=u.logarithmic())
    lq_sf = (lq + other)
    assert_allclose(lq_sf.physical, (lq.physical * other_physical))
    lq_sr = (other + lq)
    assert_allclose(lq_sr.physical, (lq.physical * other_physical))
    lq_df = (lq - other)
    assert_allclose(lq_df.physical, (lq.physical / other_physical))
    lq_dr = (other - lq)
    assert_allclose(lq_dr.physical, (other_physical / lq.physical))
