def test_check_price_exceed_raise(self, price): with pytest.raises( ValueError, match="Value of '{}' must represent a positive " "number and the max valid value is 922337203685.4775807.".format(price), ): check_price(price)
def test_check_price_bad_precision_raise(self, price): with pytest.raises( ValueError, match="must have at most 7 digits after the decimal.".format( price), ): check_price(price)
def test_check_price_type_raise(self, price): with pytest.raises( TypeError, match="amount should be type of {}, {} or {}.".format( str, Decimal, Price), ): check_price(price)
def test_check_price(self, price): check_price(price)