From ad9f1e8d550fac59df2d410424a4471d6794ed48 Mon Sep 17 00:00:00 2001 From: Carl Oscar Aaro Date: Mon, 28 Feb 2022 14:09:41 +0100 Subject: [PATCH] Applied black code style for newest changes related to arithmetic double asterisk use --- stockholm/compat/__init__.py | 1 - stockholm/money.py | 2 +- tests/test_arithmetics.py | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/stockholm/compat/__init__.py b/stockholm/compat/__init__.py index 4a58c72..90f32ac 100644 --- a/stockholm/compat/__init__.py +++ b/stockholm/compat/__init__.py @@ -10,7 +10,6 @@ class CurrencyValue(Protocol): interchangeable_with: Optional[Union[Tuple[str, ...], List[str], Set[str]]] preferred_ticker: Optional[str] - except ImportError: # pragma: no cover # Compatibility import for Python 3.7 this_module = sys.modules[__name__] diff --git a/stockholm/money.py b/stockholm/money.py index 0699c42..345f56b 100644 --- a/stockholm/money.py +++ b/stockholm/money.py @@ -849,7 +849,7 @@ def __pow__(self, other: Any) -> MoneyType: if converted_other._currency is not None: raise InvalidOperandError("Unable to use a monetary amount as an exponent") - amount = self._amount ** converted_other._amount + amount = self._amount**converted_other._amount return cls(amount, currency=self._currency) def __neg__(self) -> MoneyType: diff --git a/tests/test_arithmetics.py b/tests/test_arithmetics.py index 89ae2b2..a1693b8 100644 --- a/tests/test_arithmetics.py +++ b/tests/test_arithmetics.py @@ -247,7 +247,7 @@ def test_pow() -> None: assert m1.currency == "BIT" assert str(m1) == "2.00 BIT" - m2 = m1 ** 4 + m2 = m1**4 assert isinstance(m2, Money) assert m2.amount == 16 assert m2.currency == "BIT" @@ -260,7 +260,7 @@ def test_pow() -> None: assert str(m2) == "16.00 BIT" with pytest.raises(InvalidOperandError): - m1 ** m1 + m1**m1 assert Money(2) ** Money(4) == 16