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
2005e53e
Commit
2005e53e
authored
Mar 17, 2018
by
Paul Ganssle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make dist test fail under unicode
parent
a6e5aa4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
setuptools/tests/test_dist.py
setuptools/tests/test_dist.py
+10
-8
No files found.
setuptools/tests/test_dist.py
View file @
2005e53e
...
...
@@ -2,7 +2,6 @@
from
setuptools
import
Distribution
from
setuptools.extern.six.moves.urllib.request
import
pathname2url
from
setuptools.extern.six.moves.urllib_parse
import
urljoin
from
setuptools.extern.six
import
StringIO
from
.textwrap
import
DALS
from
.test_easy_install
import
make_nspkg_sdist
...
...
@@ -85,15 +84,15 @@ def __maintainer_test_cases():
{
'author_email'
:
'author@name.com'
,
'maintainer_email'
:
'maintainer@name.com'
})),
(
'Author unicode'
,
merge_dicts
(
attrs
,
{
'author'
:
'鉄沢寛'
})),
{
'author'
:
u
'鉄沢寛'
})),
(
'Maintainer unicode'
,
merge_dicts
(
attrs
,
{
'maintainer'
:
'Jan Łukasiewicz'
})),
{
'maintainer'
:
u
'Jan Łukasiewicz'
})),
]
return
test_cases
@
pytest
.
mark
.
parametrize
(
'name,attrs'
,
__maintainer_test_cases
())
def
test_maintainer_author
(
name
,
attrs
):
def
test_maintainer_author
(
name
,
attrs
,
tmpdir
):
tested_keys
=
{
'author'
:
'Author'
,
'author_email'
:
'Author-email'
,
...
...
@@ -103,11 +102,14 @@ def test_maintainer_author(name, attrs):
# Generate a PKG-INFO file
dist
=
Distribution
(
attrs
)
PKG_INFO
=
StringIO
()
dist
.
metadata
.
write_pkg_file
(
PKG_INFO
)
PKG_INFO
.
seek
(
0
)
fn
=
tmpdir
.
mkdir
(
'pkg_info'
)
fn_s
=
str
(
fn
)
dist
.
metadata
.
write_pkg_info
(
fn_s
)
with
open
(
str
(
fn
.
join
(
'PKG-INFO'
)),
'r'
)
as
f
:
pkg_lines
=
f
.
readlines
()
pkg_lines
=
PKG_INFO
.
readlines
()
pkg_lines
=
[
_
for
_
in
pkg_lines
if
_
]
# Drop blank lines
pkg_lines_set
=
set
(
pkg_lines
)
...
...
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