From dd9228cc45ff49869b914dc34d0de1204eccb53d Mon Sep 17 00:00:00 2001 From: Jack Hindmarch Date: Thu, 26 May 2022 00:11:28 +0100 Subject: [PATCH 1/2] Fixing tests that fail when running with optimizations (`-O`) in `test_dis.py` --- Lib/test/test_dis.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index a19cf49e658ec5..e42bdac4e40330 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -1041,11 +1041,6 @@ def get_disassembly(self, func, lasti=-1, wrapper=True, **kwargs): return output.getvalue() -if sys.flags.optimize: - code_info_consts = "0: None" -else: - code_info_consts = "0: 'Formatted details of methods, functions, or code.'" - code_info_code_info = f"""\ Name: code_info Filename: (.*) @@ -1056,7 +1051,7 @@ def get_disassembly(self, func, lasti=-1, wrapper=True, **kwargs): Stack size: \\d+ Flags: OPTIMIZED, NEWLOCALS Constants: - {code_info_consts} + 0: 'Formatted details of methods, functions, or code.' Names: 0: _format_code_info 1: _get_code_object From 0ce88765114177e584da01b7b12661729781f9f8 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Wed, 25 May 2022 23:14:09 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Tests/2022-05-25-23-14-09.gh-issue-92886.z99rtj.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Tests/2022-05-25-23-14-09.gh-issue-92886.z99rtj.rst diff --git a/Misc/NEWS.d/next/Tests/2022-05-25-23-14-09.gh-issue-92886.z99rtj.rst b/Misc/NEWS.d/next/Tests/2022-05-25-23-14-09.gh-issue-92886.z99rtj.rst new file mode 100644 index 00000000000000..ff83f1bfabe63b --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2022-05-25-23-14-09.gh-issue-92886.z99rtj.rst @@ -0,0 +1 @@ +Fixing tests that fail when running with optimizations (``-O``) in ``test_dis.py``.