Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1da08e77
Commit
1da08e77
authored
Mar 21, 2012
by
R David Murray
Browse files
Options
Browse Files
Download
Plain Diff
Merge #12757: Make doctest skipping in -OO mode work with unittest/regrtest -v
parents
520e8508
e1121537
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
Lib/doctest.py
Lib/doctest.py
+7
-3
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/doctest.py
View file @
1da08e77
...
...
@@ -2267,7 +2267,8 @@ class DocTestCase(unittest.TestCase):
return
"Doctest: "
+
self
.
_dt_test
.
name
class
SkipDocTestCase
(
DocTestCase
):
def
__init__
(
self
):
def
__init__
(
self
,
module
):
self
.
module
=
module
DocTestCase
.
__init__
(
self
,
None
)
def
setUp
(
self
):
...
...
@@ -2277,7 +2278,10 @@ class SkipDocTestCase(DocTestCase):
pass
def
shortDescription
(
self
):
return
"Skipping tests from %s"
%
module
.
__name__
return
"Skipping tests from %s"
%
self
.
module
.
__name__
__str__
=
shortDescription
def
DocTestSuite
(
module
=
None
,
globs
=
None
,
extraglobs
=
None
,
test_finder
=
None
,
**
options
):
...
...
@@ -2325,7 +2329,7 @@ def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None,
if
not
tests
and
sys
.
flags
.
optimize
>=
2
:
# Skip doctests when running with -O2
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
SkipDocTestCase
())
suite
.
addTest
(
SkipDocTestCase
(
module
))
return
suite
elif
not
tests
:
# Why do we want to do this? Because it reveals a bug that might
...
...
Misc/NEWS
View file @
1da08e77
...
...
@@ -30,6 +30,9 @@ Core and Builtins
Library
-------
-
Issue
#
12757
:
Fix
the
skipping
of
doctests
when
python
is
run
with
-
OO
so
that
it
works
in
unittest
's verbose mode as well as non-verbose mode.
- Issue #7652: Integrate the decimal floating point libmpdec library to speed
up the decimal module. Performance gains of the new C implementation are
between 12x and 80x, depending on the application.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment