From ac52d17104599ae95d5e5ae36940d8d36114a8b3 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 12 Feb 2024 16:17:49 +0200 Subject: [PATCH] gh-115341: Fix loading unit tests with doctests in -OO mode --- Lib/doctest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/doctest.py b/Lib/doctest.py index 114aac62a34e95..44068f94d9b90e 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -2225,13 +2225,13 @@ def __init__(self, test, optionflags=0, setUp=None, tearDown=None, 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)