Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
91e6df3f
Commit
91e6df3f
authored
Jan 15, 2015
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Plain Diff
merge 3.4 (#23063)
parents
e796461d
3789d73e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
4 deletions
+35
-4
command/check.py
command/check.py
+4
-4
tests/test_check.py
tests/test_check.py
+31
-0
No files found.
command/check.py
View file @
91e6df3f
...
...
@@ -122,7 +122,7 @@ class check(Command):
"""Returns warnings when the provided data doesn't compile."""
source_path
=
StringIO
()
parser
=
Parser
()
settings
=
frontend
.
OptionParser
().
get_default_values
()
settings
=
frontend
.
OptionParser
(
components
=
(
Parser
,)
).
get_default_values
()
settings
.
tab_width
=
4
settings
.
pep_references
=
None
settings
.
rfc_references
=
None
...
...
@@ -138,8 +138,8 @@ class check(Command):
document
.
note_source
(
source_path
,
-
1
)
try
:
parser
.
parse
(
data
,
document
)
except
AttributeError
:
reporter
.
messages
.
append
(
(
-
1
,
'Could not finish the parsing.'
,
''
,
{}))
except
AttributeError
as
e
:
reporter
.
messages
.
append
(
(
-
1
,
'Could not finish the parsing: %s.'
%
e
,
''
,
{}))
return
reporter
.
messages
tests/test_check.py
View file @
91e6df3f
"""Tests for distutils.command.check."""
import
textwrap
import
unittest
from
test.support
import
run_unittest
...
...
@@ -92,6 +93,36 @@ class CheckTestCase(support.LoggingSilencer,
cmd
=
self
.
_run
(
metadata
,
strict
=
1
,
restructuredtext
=
1
)
self
.
assertEqual
(
cmd
.
_warnings
,
0
)
@
unittest
.
skipUnless
(
HAS_DOCUTILS
,
"won't test without docutils"
)
def
test_check_restructuredtext_with_syntax_highlight
(
self
):
# Don't fail if there is a `code` or `code-block` directive
example_rst_docs
=
[]
example_rst_docs
.
append
(
textwrap
.
dedent
(
"""
\
Here's some code:
.. code:: python
def foo():
pass
"""
))
example_rst_docs
.
append
(
textwrap
.
dedent
(
"""
\
Here's some code:
.. code-block:: python
def foo():
pass
"""
))
for
rest_with_code
in
example_rst_docs
:
pkg_info
,
dist
=
self
.
create_dist
(
long_description
=
rest_with_code
)
cmd
=
check
(
dist
)
cmd
.
check_restructuredtext
()
self
.
assertEqual
(
cmd
.
_warnings
,
0
)
msgs
=
cmd
.
_check_rst_data
(
rest_with_code
)
self
.
assertEqual
(
len
(
msgs
),
0
)
def
test_check_all
(
self
):
metadata
=
{
'url'
:
'xxx'
,
'author'
:
'xxx'
}
...
...
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