Skip to content

Commit 9bfd176

Browse files
MasterJH5574claude
andcommitted
test(tirx): document why test_eq_ops keeps == None / != None
The `== None` / `!= None` comparisons in `test_eq_ops` are intentional: the test exercises the overloaded `__eq__` / `__ne__` operators on `IntImm` / `StringImm`, which raise `ValueError` when coerced to bool. Rewriting them as `is None` / `is not None` bypasses the overloads and breaks the test, so add a NOTE comment flagging the constraint. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 958a73d commit 9bfd176

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/python/tirx-base/test_tir_base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ def test_exception():
176176

177177

178178
def test_eq_ops():
179+
# NOTE: the `== None` / `!= None` below are intentional and must NOT be
180+
# rewritten as `is None` / `is not None`. This test exercises the overloaded
181+
# `__eq__` / `__ne__` operators on `IntImm` / `StringImm`; the `is` operators
182+
# bypass those overloads and would defeat the test.
179183
a = tirx.IntImm("int8", 1)
180184
with pytest.raises(ValueError):
181185
assert a != None

0 commit comments

Comments
 (0)