Skip to content

Commit

Permalink
TST: add a broken test to expose bug yt-project#407
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Apr 8, 2023
1 parent 7e11201 commit 2c97725
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions unyt/tests/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,15 +504,25 @@ def test_base_equivalent():
assert u.get_base_equivalent(unit_system="mks") == Unit("A")


def test_temperature_offsets():
u1 = Unit("degC")
u2 = Unit("degF")

@pytest.mark.parametrize(
("u1", "u2"),
[
(Unit("degC"), Unit("degF")),
(Unit("degC"), Unit("K")),
(Unit("degF"), Unit("K")),
],
)
def test_temperature_offsets(u1, u2):
with pytest.raises(InvalidUnitOperation):
operator.mul(u1, u2)
with pytest.raises(InvalidUnitOperation):
operator.truediv(u1, u2)

assert u1 != u2
assert u2 != u1
assert not u1 == u2
assert not u2 == u1


def test_latex_repr():
registry = UnitRegistry()
Expand Down

0 comments on commit 2c97725

Please sign in to comment.