'Check various LogUnit subclasses are equivalent and convertible
to each other if they correspond to equivalent physical units.'

@pytest.mark.parametrize(u'flu_unit,    tlu_unit,    physical_unit', itertools.product(lu_units, lu_units, pu_sample))
def test_subclass_conversion(self, flu_unit, tlu_unit, physical_unit):

    values = np.linspace(0.0, 10.0, 6)
    flu = flu_unit(physical_unit)
    tlu = tlu_unit(physical_unit)
    assert flu.is_equivalent(tlu)
    assert_allclose(flu.to(tlu), flu.function_unit.to(tlu.function_unit))
    assert_allclose(flu.to(tlu, values), (values * flu.function_unit.to(tlu.function_unit)))
    tlu2 = tlu_unit(u.Unit((100.0 * physical_unit)))
    assert flu.is_equivalent(tlu2)
    assert_allclose(flu.to(tlu2, tlu2.to(flu, values)), values, atol=1e-15)
    tlu3 = tlu_unit(physical_unit.to_system(u.si)[0])
    assert flu.is_equivalent(tlu3)
    assert_allclose(flu.to(tlu3, tlu3.to(flu, values)), values, atol=1e-15)
    tlu4 = tlu_unit(u.g)
    assert (not flu.is_equivalent(tlu4))
    with pytest.raises(u.UnitsError):
        flu.to(tlu4, values)
