From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 19 Feb 2024 17:54:59 +0000 (+0100) Subject: [3.11] gh-115341: Fix loading unit tests with doctests in -OO mode (GH-115342) (GH... X-Git-Tag: v3.11.9~175 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0bb94f49e342da4b04e14b302cceb710faa61fea;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-115341: Fix loading unit tests with doctests in -OO mode (GH-115342) (GH-115672) (cherry picked from commit 872cc9957a9c8b971448e7377fad865f351da6c9) Co-authored-by: Serhiy Storchaka --- diff --git a/Lib/doctest.py b/Lib/doctest.py index f4396c8f7ad9..03db27799289 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -2197,13 +2197,13 @@ class DocTestCase(unittest.TestCase): unittest.TestCase.__init__(self) self._dt_optionflags = optionflags self._dt_checker = checker - self._dt_globs = test.globs.copy() self._dt_test = test self._dt_setUp = setUp self._dt_tearDown = tearDown def setUp(self): test = self._dt_test + self._dt_globs = test.globs.copy() if self._dt_setUp is not None: self._dt_setUp(test)