diff options
| author | Damien George <damien@micropython.org> | 2021-05-30 09:42:27 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-05-30 13:41:37 +1000 |
| commit | 025e4b6fbc32cd3118a5519cf6a18aa04b045abe (patch) | |
| tree | e5c742abc37c46d30d1338b9ce4db399d0eb5713 /tests/basics/is_isnot_literal.py | |
| parent | 486fe71c6ee3fbc4bbebf348832e88880b8a5bae (diff) | |
tests/basics: Split out literal tests that raise SyntaxWarning on CPy.
Fixes issue #7330.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/basics/is_isnot_literal.py')
| -rw-r--r-- | tests/basics/is_isnot_literal.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/basics/is_isnot_literal.py b/tests/basics/is_isnot_literal.py new file mode 100644 index 000000000..1626fa949 --- /dev/null +++ b/tests/basics/is_isnot_literal.py @@ -0,0 +1,13 @@ +# test "is" and "is not" with literal arguments +# these raise a SyntaxWarning in CPython because the results are +# implementation dependent; see https://bugs.python.org/issue34850 + +print(1 is 1) +print(1 is 2) +print(1 is not 1) +print(1 is not 2) + +print("a" is "a") +print("a" is "b") +print("a" is not "a") +print("a" is not "b") |
