Skip to content

Commit

Permalink
Pass on some coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdrozd committed Sep 7, 2023
1 parent cf5a0ce commit 653a7d4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tm/num.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def __add__(self, other: Count) -> Count:
return other.l + (other.r + self)

if isinstance(other.l, Mul):
if other.l.l == self.l:
if other.l.l == self.l: # pragma: no branch
return (self + other.l) + other.r

elif isinstance(other, Exp):
Expand Down Expand Up @@ -585,10 +585,11 @@ def gcd(den: int, num: Count) -> int:
if isinstance(num, Mul):
return max(gcd(den, num.l), gcd(den, num.r))

if isinstance(num, Div):
if isinstance(num, Div): # no-coverage
return den

if isinstance(num, Exp) and isinstance(base := num.base, int):
if (isinstance(num, Exp)
and isinstance(base := num.base, int)): # pragma: no branch
val, exp = 1, num.exp

while den % base == 0: # pylint: disable = while-used
Expand All @@ -598,7 +599,7 @@ def gcd(den: int, num: Count) -> int:

return val

return 1
return 1 # no-coverage

########################################

Expand Down

0 comments on commit 653a7d4

Please sign in to comment.