def test_pow(): """Exponentiation of quantities.""" REGISTRY.clear() define_units() m_unit = unit('m') m_quant = Quantity(2, m_unit) assert (m_quant ** 2 == m_quant * m_quant == pow(m_quant, 2)) cm_unit = unit('cm') cm_quant = Quantity(2, cm_unit) assert within_epsilon(cm_quant ** 2, cm_quant * cm_quant) assert within_epsilon(cm_quant ** 2, pow(cm_quant, 2))
def teardown_module(module): # Disable warning about not using module. # pylint: disable=W0613 """Called after running all of the tests here.""" REGISTRY.clear()