summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-02-19 17:03:21 (GMT)
committerGitHub <noreply@github.com>2024-02-19 17:03:21 (GMT)
commit872cc9957a9c8b971448e7377fad865f351da6c9 (patch)
treeb0a27104968cadfbb3812e1a6660891eb22f414f
parent07ef9d86a5efa82d06a8e7e15dd3aff1e946aa6b (diff)
downloadcpython-872cc9957a9c8b971448e7377fad865f351da6c9.zip
cpython-872cc9957a9c8b971448e7377fad865f351da6c9.tar.gz
cpython-872cc9957a9c8b971448e7377fad865f351da6c9.tar.bz2
gh-115341: Fix loading unit tests with doctests in -OO mode (GH-115342)
-rw-r--r--Lib/doctest.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index 1969777..6049423 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -2225,13 +2225,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)