Skip to content

Commit 414c3b4

Browse files
author
Greg Brooks
committed
Compare enums by identity (#1956)
1 parent 300a70b commit 414c3b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def test_state_with_str(self):
218218
)
219219
state = can_cfg["state"]
220220
assert isinstance(state, can.BusState)
221-
assert state == can.BusState.PASSIVE
221+
assert state is can.BusState.PASSIVE
222222

223223
def test_state_with_enum(self):
224224
expected_state = can.BusState.PASSIVE
@@ -230,7 +230,7 @@ def test_state_with_enum(self):
230230
)
231231
state = can_cfg["state"]
232232
assert isinstance(state, can.BusState)
233-
assert state == expected_state
233+
assert state is expected_state
234234

235235

236236
class TestChannel2Int(unittest.TestCase):

0 commit comments

Comments
 (0)