mirror of https://github.com/python/cpython
gh-115341: Fix loading unit tests with doctests in -OO mode (GH-115342)
This commit is contained in:
parent
07ef9d86a5
commit
872cc9957a
|
@ -2225,13 +2225,13 @@ class DocTestCase(unittest.TestCase):
|
||||||
unittest.TestCase.__init__(self)
|
unittest.TestCase.__init__(self)
|
||||||
self._dt_optionflags = optionflags
|
self._dt_optionflags = optionflags
|
||||||
self._dt_checker = checker
|
self._dt_checker = checker
|
||||||
self._dt_globs = test.globs.copy()
|
|
||||||
self._dt_test = test
|
self._dt_test = test
|
||||||
self._dt_setUp = setUp
|
self._dt_setUp = setUp
|
||||||
self._dt_tearDown = tearDown
|
self._dt_tearDown = tearDown
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
test = self._dt_test
|
test = self._dt_test
|
||||||
|
self._dt_globs = test.globs.copy()
|
||||||
|
|
||||||
if self._dt_setUp is not None:
|
if self._dt_setUp is not None:
|
||||||
self._dt_setUp(test)
|
self._dt_setUp(test)
|
||||||
|
|
Loading…
Reference in New Issue