diff options
author | sobolevn <mail@sobolevn.me> | 2024-08-26 18:59:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-26 18:59:50 (GMT) |
commit | 1eed0f968f5f44d6a13403c1676298a322cbfbad (patch) | |
tree | 4c414e4f2c6a6688a2e78faa9fbb5f631715c1de /Lib/test | |
parent | 7bd6ebf696efcd5cf8e4e7946f9d8d8aee05664c (diff) | |
download | cpython-1eed0f968f5f44d6a13403c1676298a322cbfbad.zip cpython-1eed0f968f5f44d6a13403c1676298a322cbfbad.tar.gz cpython-1eed0f968f5f44d6a13403c1676298a322cbfbad.tar.bz2 |
gh-123340: Show string value of `IS_OP` oparg in `dis` (#123348)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_dis.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index db69bc7..ab0fcee 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -2028,6 +2028,15 @@ class InstructionTests(InstructionTestCase): dis.dis(f.__code__, file=output, show_caches=True) self.assertIn("L1:", output.getvalue()) + def test_is_op_format(self): + output = io.StringIO() + dis.dis("a is b", file=output, show_caches=True) + self.assertIn("IS_OP 0 (is)", output.getvalue()) + + output = io.StringIO() + dis.dis("a is not b", file=output, show_caches=True) + self.assertIn("IS_OP 1 (is not)", output.getvalue()) + def test_baseopname_and_baseopcode(self): # Standard instructions for name, code in dis.opmap.items(): |