'Check that conversion to logarithmic units (u.mag, u.dB, u.dex)
is only possible when the physical unit is dimensionless.'

@pytest.mark.parametrize(u'lu_unit', lu_units)
def test_container_unit_conversion(self, lu_unit):

    values = np.linspace(0.0, 10.0, 6)
    lu1 = lu_unit(u.dimensionless_unscaled)
    assert lu1.is_equivalent(lu1.function_unit)
    assert_allclose(lu1.to(lu1.function_unit, values), values)
    lu2 = lu_unit(u.Jy)
    assert (not lu2.is_equivalent(lu2.function_unit))
    with pytest.raises(u.UnitsError):
        lu2.to(lu2.function_unit, values)
