Skip to content

Commit

Permalink
test coverage for type error (#1845)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonemo committed Sep 22, 2023
1 parent 247512b commit a8906a5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pint/testsuite/test_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -1150,3 +1150,10 @@ def test_issues_1505():
assert isinstance(
ur.Quantity("m/s").magnitude, decimal.Decimal
) # unexpected fail (magnitude should be a decimal)


def test_issue_1845():
ur = UnitRegistry(auto_reduce_dimensions=True, non_int_type=decimal.Decimal)
# before issue 1845 these inputs would have resulted in a TypeError
assert ur("km / h * m").units == ur.Quantity("meter ** 2 / hour")
assert ur("kW / min * W").units == ur.Quantity("watts ** 2 / minute")

0 comments on commit a8906a5

Please sign in to comment.