From 8150b8cf7fe09d601246f5bdc6456a0e31f31bca Mon Sep 17 00:00:00 2001 From: jackh-ncl <1750152+jackh-ncl@users.noreply.github.com> Date: Sat, 4 Jun 2022 04:15:58 +0100 Subject: [PATCH] gh-92886: Fix test that fails when running with `-O` in `test_imaplib.py` (#93237) --- Lib/test/test_imaplib.py | 1 + .../next/Tests/2022-05-25-23-07-15.gh-issue-92886.Aki63_.rst | 1 + 2 files changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2022-05-25-23-07-15.gh-issue-92886.Aki63_.rst diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index ff13edea2d1e4a..ed26fa16d6ea8b 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -939,6 +939,7 @@ def test_with_statement_logout(self): @threading_helper.reap_threads @cpython_only + @unittest.skipUnless(__debug__, "Won't work if __debug__ is False") def test_dump_ur(self): # See: http://bugs.python.org/issue26543 untagged_resp_dict = {'READ-WRITE': [b'']} diff --git a/Misc/NEWS.d/next/Tests/2022-05-25-23-07-15.gh-issue-92886.Aki63_.rst b/Misc/NEWS.d/next/Tests/2022-05-25-23-07-15.gh-issue-92886.Aki63_.rst new file mode 100644 index 00000000000000..581f6bfea24b6e --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2022-05-25-23-07-15.gh-issue-92886.Aki63_.rst @@ -0,0 +1 @@ +Fixing tests that fail when running with optimizations (``-O``) in ``test_imaplib.py``.