Skip to content

Commit d541661

Browse files
committed
Avoid SyntaxWarnings in test_if
1 parent 3bee328 commit d541661

File tree

1 file changed

+8
-4
lines changed
  • graalpython/com.oracle.graal.python.test/src/tests

1 file changed

+8
-4
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_id.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,18 @@ def test_id_is_constant_even_when_object_changes():
6868
assert id(l) == lid
6969

7070
def test_identity():
71-
assert True is True
71+
val = True
72+
assert val is True
7273
assert memoryview(b"").readonly is True # compare a PInt bool (from C) to a boolean
7374

74-
assert 12 is 12
75+
val = 12
76+
assert val is 12
7577
assert memoryview(b"123").nbytes == 3 # compare PInt (from C) to an int
7678
class I(int): pass
77-
assert I(12) is not 12
78-
assert 12.0 is 12.0
79+
val = I(12)
80+
assert val is not 12
81+
val = 12.0
82+
assert val is 12.0
7983

8084
nan = float('nan')
8185
assert nan is nan

0 commit comments

Comments
 (0)