def test_power_type_error(): a = Rational(17, 23) with pytest.raises(TypeError): a.power(4.3)
def test_power_square(): a = Rational(17, 23) assert str(a.square()) == str(a.power(2))