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
5cd86987
Commit
5cd86987
authored
Jan 26, 2019
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feed the hobgoblins (delint).
parent
050c0cbd
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
183 additions
and
140 deletions
+183
-140
setuptools/tests/files.py
setuptools/tests/files.py
+6
-3
setuptools/tests/server.py
setuptools/tests/server.py
+8
-6
setuptools/tests/test_build_clib.py
setuptools/tests/test_build_clib.py
+4
-5
setuptools/tests/test_config.py
setuptools/tests/test_config.py
+10
-6
setuptools/tests/test_depends.py
setuptools/tests/test_depends.py
+9
-9
setuptools/tests/test_dist.py
setuptools/tests/test_dist.py
+9
-6
setuptools/tests/test_easy_install.py
setuptools/tests/test_easy_install.py
+4
-2
setuptools/tests/test_egg_info.py
setuptools/tests/test_egg_info.py
+3
-2
setuptools/tests/test_find_packages.py
setuptools/tests/test_find_packages.py
+6
-5
setuptools/tests/test_install_scripts.py
setuptools/tests/test_install_scripts.py
+4
-2
setuptools/tests/test_integration.py
setuptools/tests/test_integration.py
+14
-9
setuptools/tests/test_manifest.py
setuptools/tests/test_manifest.py
+67
-66
setuptools/tests/test_msvc.py
setuptools/tests/test_msvc.py
+3
-2
setuptools/tests/test_namespaces.py
setuptools/tests/test_namespaces.py
+0
-1
setuptools/tests/test_packageindex.py
setuptools/tests/test_packageindex.py
+12
-5
setuptools/tests/test_pep425tags.py
setuptools/tests/test_pep425tags.py
+3
-1
setuptools/tests/test_sandbox.py
setuptools/tests/test_sandbox.py
+2
-1
setuptools/tests/test_setuptools.py
setuptools/tests/test_setuptools.py
+6
-3
setuptools/tests/test_test.py
setuptools/tests/test_test.py
+0
-1
setuptools/tests/test_virtualenv.py
setuptools/tests/test_virtualenv.py
+1
-2
setuptools/tests/test_wheel.py
setuptools/tests/test_wheel.py
+2
-0
setuptools/tests/test_windows_wrappers.py
setuptools/tests/test_windows_wrappers.py
+10
-3
No files found.
setuptools/tests/files.py
View file @
5cd86987
...
...
@@ -6,10 +6,13 @@ import pkg_resources.py31compat
def
build_files
(
file_defs
,
prefix
=
""
):
"""
Build a set of files/directories, as described by the file_defs dictionary.
Build a set of files/directories, as described by the
file_defs dictionary.
Each key/value pair in the dictionary is interpreted as a filename/contents
pair. If the contents value is a dictionary, a directory is created, and the
Each key/value pair in the dictionary is interpreted as
a filename/contents
pair. If the contents value is a dictionary, a directory
is created, and the
dictionary interpreted as the files within it, recursively.
For example:
...
...
setuptools/tests/server.py
View file @
5cd86987
...
...
@@ -19,10 +19,11 @@ class IndexServer(BaseHTTPServer.HTTPServer):
s.stop()
"""
def
__init__
(
self
,
server_address
=
(
''
,
0
),
def
__init__
(
self
,
server_address
=
(
''
,
0
),
RequestHandlerClass
=
SimpleHTTPServer
.
SimpleHTTPRequestHandler
):
BaseHTTPServer
.
HTTPServer
.
__init__
(
self
,
server_address
,
RequestHandlerClass
)
BaseHTTPServer
.
HTTPServer
.
__init__
(
self
,
server_address
,
RequestHandlerClass
)
self
.
_run
=
True
def
start
(
self
):
...
...
@@ -56,10 +57,11 @@ class MockServer(BaseHTTPServer.HTTPServer, threading.Thread):
A simple HTTP Server that records the requests made to it.
"""
def
__init__
(
self
,
server_address
=
(
''
,
0
),
def
__init__
(
self
,
server_address
=
(
''
,
0
),
RequestHandlerClass
=
RequestRecorder
):
BaseHTTPServer
.
HTTPServer
.
__init__
(
self
,
server_address
,
RequestHandlerClass
)
BaseHTTPServer
.
HTTPServer
.
__init__
(
self
,
server_address
,
RequestHandlerClass
)
threading
.
Thread
.
__init__
(
self
)
self
.
setDaemon
(
True
)
self
.
requests
=
[]
...
...
setuptools/tests/test_build_clib.py
View file @
5cd86987
import
pytest
import
os
import
shutil
import
mock
from
distutils.errors
import
DistutilsSetupError
...
...
@@ -40,13 +38,14 @@ class TestBuildCLib:
# with that out of the way, let's see if the crude dependency
# system works
cmd
.
compiler
=
mock
.
MagicMock
(
spec
=
cmd
.
compiler
)
mock_newer
.
return_value
=
([],[])
mock_newer
.
return_value
=
([],
[])
obj_deps
=
{
''
:
(
'global.h'
,),
'example.c'
:
(
'example.h'
,)}
libs
=
[(
'example'
,
{
'sources'
:
[
'example.c'
]
,
'obj_deps'
:
obj_deps
})]
libs
=
[(
'example'
,
{
'sources'
:
[
'example.c'
]
,
'obj_deps'
:
obj_deps
})]
cmd
.
build_libraries
(
libs
)
assert
[[
'example.c'
,
'global.h'
,
'example.h'
]]
in
mock_newer
.
call_args
[
0
]
assert
[[
'example.c'
,
'global.h'
,
'example.h'
]]
in
\
mock_newer
.
call_args
[
0
]
assert
not
cmd
.
compiler
.
compile
.
called
assert
cmd
.
compiler
.
create_static_lib
.
call_count
==
1
...
...
setuptools/tests/test_config.py
View file @
5cd86987
...
...
@@ -8,6 +8,7 @@ from setuptools.config import ConfigHandler, read_configuration
from
.
import
py2_only
,
py3_only
from
.textwrap
import
DALS
class
ErrConfigHandler
(
ConfigHandler
):
"""Erroneous handler. Fails to implement required methods."""
...
...
@@ -18,8 +19,8 @@ def make_package_dir(name, base_dir, ns=False):
dir_package
=
dir_package
.
mkdir
(
dir_name
)
init_file
=
None
if
not
ns
:
init_file
=
dir_package
.
join
(
'__init__.py'
)
init_file
.
write
(
''
)
init_file
=
dir_package
.
join
(
'__init__.py'
)
init_file
.
write
(
''
)
return
dir_package
,
init_file
...
...
@@ -308,7 +309,7 @@ class TestMetadata:
tmpdir
.
join
(
'fake_package'
,
'version.txt'
).
write
(
'1.2.3
\
n
4.5.6
\
n
'
)
with
pytest
.
raises
(
DistutilsOptionError
):
with
get_dist
(
tmpdir
)
as
dist
:
_
=
dist
.
metadata
.
version
dist
.
metadata
.
version
def
test_version_with_package_dir_simple
(
self
,
tmpdir
):
...
...
@@ -451,7 +452,7 @@ class TestOptions:
'tests_require = mock==0.7.2; pytest
\
n
'
'setup_requires = docutils>=0.3; spack ==1.1, ==1.3; there
\
n
'
'dependency_links = http://some.com/here/1, '
'http://some.com/there/2
\
n
'
'http://some.com/there/2
\
n
'
'python_requires = >=1.0, !=2.8
\
n
'
'py_modules = module1, module2
\
n
'
)
...
...
@@ -659,7 +660,7 @@ class TestOptions:
dir_sub_two
,
_
=
make_package_dir
(
'sub_two'
,
dir_package
,
ns
=
True
)
with
get_dist
(
tmpdir
)
as
dist
:
assert
set
(
dist
.
packages
)
==
{
assert
set
(
dist
.
packages
)
==
{
'fake_package'
,
'fake_package.sub_two'
,
'fake_package.sub_one'
}
...
...
@@ -711,7 +712,7 @@ class TestOptions:
tmpdir
,
'[options.entry_points]
\
n
'
'group1 = point1 = pack.module:func, '
'.point2 = pack.module2:func_rest [rest]
\
n
'
'.point2 = pack.module2:func_rest [rest]
\
n
'
'group2 = point3 = pack.module:func2
\
n
'
)
...
...
@@ -757,7 +758,10 @@ class TestOptions:
]
assert
sorted
(
dist
.
data_files
)
==
sorted
(
expected
)
saved_dist_init
=
_Distribution
.
__init__
class
TestExternalSetters
:
# During creation of the setuptools Distribution() object, we call
# the init of the parent distutils Distribution object via
...
...
setuptools/tests/test_depends.py
View file @
5cd86987
...
...
@@ -5,12 +5,12 @@ from setuptools import depends
class
TestGetModuleConstant
:
def
test_basic
(
self
):
"""
Invoke get_module_constant on a module in
the test package.
"""
mod_name
=
'setuptools.tests.mod_with_constant'
val
=
depends
.
get_module_constant
(
mod_name
,
'value'
)
assert
val
==
'three, sir!'
assert
'setuptools.tests.mod_with_constant'
not
in
sys
.
modules
def
test_basic
(
self
):
"""
Invoke get_module_constant on a module in
the test package.
"""
mod_name
=
'setuptools.tests.mod_with_constant'
val
=
depends
.
get_module_constant
(
mod_name
,
'value'
)
assert
val
==
'three, sir!'
assert
'setuptools.tests.mod_with_constant'
not
in
sys
.
modules
setuptools/tests/test_dist.py
View file @
5cd86987
...
...
@@ -14,6 +14,7 @@ from .test_easy_install import make_nspkg_sdist
import
pytest
def
test_dist_fetch_build_egg
(
tmpdir
):
"""
Check multiple calls to `Distribution.fetch_build_egg` work as expected.
...
...
@@ -90,30 +91,32 @@ def __read_test_cases():
'classifiers'
:
[
'Programming Language :: Python :: 3'
,
'Programming Language :: Python :: 3.7'
,
'License :: OSI Approved :: MIT License'
]})),
'License :: OSI Approved :: MIT License'
,
]})),
(
'Metadata version 1.1: Download URL'
,
merge_dicts
(
base_attrs
,
{
'download_url'
:
'https://example.com'
})),
(
'Metadata Version 1.2: Requires-Python'
,
merge_dicts
(
base_attrs
,
{
'python_requires'
:
'>=3.7'
})),
pytest
.
param
(
'Metadata Version 1.2: Project-Url'
,
pytest
.
param
(
'Metadata Version 1.2: Project-Url'
,
merge_dicts
(
base_attrs
,
{
'project_urls'
:
{
'Foo'
:
'https://example.bar'
}
}),
marks
=
pytest
.
mark
.
xfail
(
reason
=
"Issue #1578: project_urls not read"
)),
)),
(
'Metadata Version 2.1: Long Description Content Type'
,
merge_dicts
(
base_attrs
,
{
'long_description_content_type'
:
'text/x-rst; charset=UTF-8'
})),
pytest
.
param
(
'Metadata Version 2.1: Provides Extra'
,
pytest
.
param
(
'Metadata Version 2.1: Provides Extra'
,
merge_dicts
(
base_attrs
,
{
'provides_extras'
:
[
'foo'
,
'bar'
]
}),
marks
=
pytest
.
mark
.
xfail
(
reason
=
"provides_extras not read"
)),
}),
marks
=
pytest
.
mark
.
xfail
(
reason
=
"provides_extras not read"
)),
(
'Missing author, missing author e-mail'
,
{
'name'
:
'foo'
,
'version'
:
'1.0.0'
}),
(
'Missing author'
,
...
...
setuptools/tests/test_easy_install.py
View file @
5cd86987
...
...
@@ -15,7 +15,9 @@ import distutils.errors
import
io
import
zipfile
import
mock
from
setuptools.command.easy_install
import
EasyInstallDeprecationWarning
,
ScriptWriter
,
WindowsScriptWriter
from
setuptools.command.easy_install
import
(
EasyInstallDeprecationWarning
,
ScriptWriter
,
WindowsScriptWriter
,
)
import
time
from
setuptools.extern
import
six
from
setuptools.extern.six.moves
import
urllib
...
...
@@ -287,7 +289,6 @@ class TestEasyInstallTest:
cmd
.
easy_install
(
sdist_script
)
assert
(
target
/
'mypkg_script'
).
exists
()
def
test_dist_get_script_args_deprecated
(
self
):
with
pytest
.
warns
(
EasyInstallDeprecationWarning
):
ScriptWriter
.
get_script_args
(
None
,
None
)
...
...
@@ -304,6 +305,7 @@ class TestEasyInstallTest:
with
pytest
.
warns
(
EasyInstallDeprecationWarning
):
WindowsScriptWriter
.
get_writer
()
@
pytest
.
mark
.
filterwarnings
(
'ignore:Unbuilt egg'
)
class
TestPTHFileWriter
:
def
test_add_from_cwd_site_sets_dirty
(
self
):
...
...
setuptools/tests/test_egg_info.py
View file @
5cd86987
import
datetime
import
sys
import
ast
import
os
...
...
@@ -7,7 +6,9 @@ import re
import
stat
import
time
from
setuptools.command.egg_info
import
egg_info
,
manifest_maker
,
EggInfoDeprecationWarning
,
get_pkg_info_revision
from
setuptools.command.egg_info
import
(
egg_info
,
manifest_maker
,
EggInfoDeprecationWarning
,
get_pkg_info_revision
,
)
from
setuptools.dist
import
Distribution
from
setuptools.extern.six.moves
import
map
...
...
setuptools/tests/test_find_packages.py
View file @
5cd86987
...
...
@@ -12,10 +12,10 @@ from . import py3_only
from
setuptools.extern.six
import
PY3
from
setuptools
import
find_packages
if
PY3
:
from
setuptools
import
find_namespace_packages
from
setuptools
import
find_namespace_packages
# modeled after CPython's test.support.can_symlink
# modeled after CPython's test.support.can_symlink
def
can_symlink
():
TESTFN
=
tempfile
.
mktemp
()
symlink_path
=
TESTFN
+
"can_symlink"
...
...
@@ -164,12 +164,14 @@ class TestFindPackages:
def
test_pep420_ns_package_no_includes
(
self
):
packages
=
find_namespace_packages
(
self
.
dist_dir
,
exclude
=
[
'pkg.subpkg.assets'
])
self
.
_assert_packages
(
packages
,
[
'docs'
,
'pkg'
,
'pkg.nspkg'
,
'pkg.subpkg'
])
self
.
_assert_packages
(
packages
,
[
'docs'
,
'pkg'
,
'pkg.nspkg'
,
'pkg.subpkg'
])
@
py3_only
def
test_pep420_ns_package_no_includes_or_excludes
(
self
):
packages
=
find_namespace_packages
(
self
.
dist_dir
)
expected
=
[
'docs'
,
'pkg'
,
'pkg.nspkg'
,
'pkg.subpkg'
,
'pkg.subpkg.assets'
]
expected
=
[
'docs'
,
'pkg'
,
'pkg.nspkg'
,
'pkg.subpkg'
,
'pkg.subpkg.assets'
]
self
.
_assert_packages
(
packages
,
expected
)
@
py3_only
...
...
@@ -185,4 +187,3 @@ class TestFindPackages:
shutil
.
rmtree
(
os
.
path
.
join
(
self
.
dist_dir
,
'pkg/subpkg/assets'
))
packages
=
find_namespace_packages
(
self
.
dist_dir
)
self
.
_assert_packages
(
packages
,
[
'pkg'
,
'pkg.nspkg'
,
'pkg.subpkg'
])
setuptools/tests/test_install_scripts.py
View file @
5cd86987
...
...
@@ -64,7 +64,8 @@ class TestInstallScripts:
@
pytest
.
mark
.
skipif
(
sys
.
platform
==
'win32'
,
reason
=
'non-Windows only'
)
def
test_executable_with_spaces_escaping_unix
(
self
,
tmpdir
):
"""
Ensure that shebang on Unix is not quoted, even when a value with spaces
Ensure that shebang on Unix is not quoted, even when
a value with spaces
is specified using --executable.
"""
expected
=
'#!%s
\
n
'
%
self
.
unix_spaces_exe
...
...
@@ -77,7 +78,8 @@ class TestInstallScripts:
@
pytest
.
mark
.
skipif
(
sys
.
platform
!=
'win32'
,
reason
=
'Windows only'
)
def
test_executable_arg_escaping_win32
(
self
,
tmpdir
):
"""
Ensure that shebang on Windows is quoted when getting a path with spaces
Ensure that shebang on Windows is quoted when
getting a path with spaces
from --executable, that is itself properly quoted.
"""
expected
=
'#!"%s"
\
n
'
%
self
.
win32_exe
...
...
setuptools/tests/test_integration.py
View file @
5cd86987
...
...
@@ -6,6 +6,11 @@ Try to install a few packages.
import
glob
import
os
import
sys
import
re
import
subprocess
import
functools
import
tarfile
import
zipfile
from
setuptools.extern.six.moves
import
urllib
import
pytest
...
...
@@ -114,15 +119,12 @@ def test_pyuri(install_context):
assert
os
.
path
.
exists
(
os
.
path
.
join
(
pyuri
.
location
,
'pyuri'
,
'uri.regex'
))
import
re
import
subprocess
import
functools
import
tarfile
,
zipfile
build_deps
=
[
'appdirs'
,
'packaging'
,
'pyparsing'
,
'six'
]
build_deps
=
[
'appdirs'
,
'packaging'
,
'pyparsing'
,
'six'
]
@
pytest
.
mark
.
parametrize
(
"build_dep"
,
build_deps
)
@
pytest
.
mark
.
skipif
(
sys
.
version_info
<
(
3
,
6
),
reason
=
'run only on late versions'
)
@
pytest
.
mark
.
skipif
(
sys
.
version_info
<
(
3
,
6
),
reason
=
'run only on late versions'
)
def
test_build_deps_on_distutils
(
request
,
tmpdir_factory
,
build_dep
):
"""
All setuptools build dependencies must build without
...
...
@@ -149,13 +151,16 @@ def install(pkg_dir, install_dir):
breaker
.
write
(
'raise ImportError()'
)
cmd
=
[
sys
.
executable
,
'setup.py'
,
'install'
,
'--prefix'
,
install_dir
]
env
=
dict
(
os
.
environ
,
PYTHONPATH
=
pkg_dir
)
output
=
subprocess
.
check_output
(
cmd
,
cwd
=
pkg_dir
,
env
=
env
,
stderr
=
subprocess
.
STDOUT
)
output
=
subprocess
.
check_output
(
cmd
,
cwd
=
pkg_dir
,
env
=
env
,
stderr
=
subprocess
.
STDOUT
)
return
output
.
decode
(
'utf-8'
)
def
download_and_extract
(
request
,
req
,
target
):
cmd
=
[
sys
.
executable
,
'-m'
,
'pip'
,
'download'
,
'--no-deps'
,
'--no-binary'
,
':all:'
,
req
]
cmd
=
[
sys
.
executable
,
'-m'
,
'pip'
,
'download'
,
'--no-deps'
,
'--no-binary'
,
':all:'
,
req
,
]
output
=
subprocess
.
check_output
(
cmd
,
encoding
=
'utf-8'
)
filename
=
re
.
search
(
'Saved (.*)'
,
output
).
group
(
1
)
request
.
addfinalizer
(
functools
.
partial
(
os
.
remove
,
filename
))
...
...
setuptools/tests/test_manifest.py
View file @
5cd86987
This diff is collapsed.
Click to expand it.
setuptools/tests/test_msvc.py
View file @
5cd86987
...
...
@@ -49,7 +49,8 @@ def mock_reg(hkcu=None, hklm=None):
for
k
in
hive
if
k
.
startswith
(
key
.
lower
())
)
return
mock
.
patch
.
multiple
(
distutils
.
msvc9compiler
.
Reg
,
return
mock
.
patch
.
multiple
(
distutils
.
msvc9compiler
.
Reg
,
read_keys
=
read_keys
,
read_values
=
read_values
)
...
...
@@ -61,7 +62,7 @@ class TestModulePatch:
"""
key_32
=
r'software\
mic
rosoft\
de
vdiv\vcforpython\
9.
0\
i
nstalldir'
key_64
=
r'software\
wow
6432node\
mic
rosoft\
de
vdiv\vcforpython\
9.
0\
i
nstalldir'
key_64
=
key_32
.
replace
(
r'\
mic
rosoft'
,
r'\
wow
6432node\
mic
rosoft'
)
def
test_patched
(
self
):
"Test the module is actually patched"
...
...
setuptools/tests/test_namespaces.py
View file @
5cd86987
from
__future__
import
absolute_import
,
unicode_literals
import
os
import
sys
import
subprocess
...
...
setuptools/tests/test_packageindex.py
View file @
5cd86987
...
...
@@ -44,7 +44,10 @@ class TestPackageIndex:
hosts
=
(
'www.example.com'
,)
)
url
=
'url:%20https://svn.plone.org/svn/collective/inquant.contentmirror.plone/trunk'
url
=
(
'url:%20https://svn.plone.org/svn'
'/collective/inquant.contentmirror.plone/trunk'
)
try
:
v
=
index
.
open_url
(
url
)
except
Exception
as
v
:
...
...
@@ -63,9 +66,9 @@ class TestPackageIndex:
index
.
opener
=
_urlopen
url
=
'http://example.com'
try
:
v
=
index
.
open_url
(
url
)
except
Exception
as
v
:
assert
'line'
in
str
(
v
)
index
.
open_url
(
url
)
except
Exception
as
exc
:
assert
'line'
in
str
(
exc
)
else
:
raise
AssertionError
(
'Should have raise here!'
)
...
...
@@ -83,7 +86,11 @@ class TestPackageIndex:
index
.
open_url
(
url
)
except
distutils
.
errors
.
DistutilsError
as
error
:
msg
=
six
.
text_type
(
error
)
assert
'nonnumeric port'
in
msg
or
'getaddrinfo failed'
in
msg
or
'Name or service not known'
in
msg
assert
(
'nonnumeric port'
in
msg
or
'getaddrinfo failed'
in
msg
or
'Name or service not known'
in
msg
)
return
raise
RuntimeError
(
"Did not raise"
)
...
...
setuptools/tests/test_pep425tags.py
View file @
5cd86987
...
...
@@ -32,7 +32,9 @@ class TestPEP425Tags:
if
sys
.
version_info
<
(
3
,
3
):
config_vars
.
update
({
'Py_UNICODE_SIZE'
:
2
})
mock_gcf
=
self
.
mock_get_config_var
(
**
config_vars
)
with
patch
(
'setuptools.pep425tags.sysconfig.get_config_var'
,
mock_gcf
):
with
patch
(
'setuptools.pep425tags.sysconfig.get_config_var'
,
mock_gcf
):
abi_tag
=
pep425tags
.
get_abi_tag
()
assert
abi_tag
==
base
+
flags
...
...
setuptools/tests/test_sandbox.py
View file @
5cd86987
...
...
@@ -26,7 +26,8 @@ class TestSandbox:
"""
It should be possible to execute a setup.py with a Byte Order Mark
"""
target
=
pkg_resources
.
resource_filename
(
__name__
,
target
=
pkg_resources
.
resource_filename
(
__name__
,
'script-with-bom.py'
)
namespace
=
types
.
ModuleType
(
'namespace'
)
setuptools
.
sandbox
.
_execfile
(
target
,
vars
(
namespace
))
...
...
setuptools/tests/test_setuptools.py
View file @
5cd86987
...
...
@@ -77,7 +77,8 @@ class TestDepends:
from
json
import
__version__
assert
dep
.
get_module_constant
(
'json'
,
'__version__'
)
==
__version__
assert
dep
.
get_module_constant
(
'sys'
,
'version'
)
==
sys
.
version
assert
dep
.
get_module_constant
(
'setuptools.tests.test_setuptools'
,
'__doc__'
)
==
__doc__
assert
dep
.
get_module_constant
(
'setuptools.tests.test_setuptools'
,
'__doc__'
)
==
__doc__
@
needs_bytecode
def
testRequire
(
self
):
...
...
@@ -216,7 +217,8 @@ class TestFeatures:
self
.
req
=
Require
(
'Distutils'
,
'1.0.3'
,
'distutils'
)
self
.
dist
=
makeSetup
(
features
=
{
'foo'
:
Feature
(
"foo"
,
standard
=
True
,
require_features
=
[
'baz'
,
self
.
req
]),
'foo'
:
Feature
(
"foo"
,
standard
=
True
,
require_features
=
[
'baz'
,
self
.
req
]),
'bar'
:
Feature
(
"bar"
,
standard
=
True
,
packages
=
[
'pkg.bar'
],
py_modules
=
[
'bar_et'
],
remove
=
[
'bar.ext'
],
),
...
...
@@ -252,7 +254,8 @@ class TestFeatures:
(
'with-dwim'
,
None
,
'include DWIM'
)
in
dist
.
feature_options
)
assert
(
(
'without-dwim'
,
None
,
'exclude DWIM (default)'
)
in
dist
.
feature_options
(
'without-dwim'
,
None
,
'exclude DWIM (default)'
)
in
dist
.
feature_options
)
assert
(
(
'with-bar'
,
None
,
'include bar (default)'
)
in
dist
.
feature_options
...
...
setuptools/tests/test_test.py
View file @
5cd86987
...
...
@@ -4,7 +4,6 @@ from __future__ import unicode_literals
from
distutils
import
log
import
os
import
sys
import
pytest
...
...
setuptools/tests/test_virtualenv.py
View file @
5cd86987
import
distutils.command
import
glob
import
os
import
sys
...
...
@@ -141,7 +140,7 @@ def test_no_missing_dependencies(bare_virtualenv):
"""
Quick and dirty test to ensure all external dependencies are vendored.
"""
for
command
in
(
'upload'
,):
#
sorted(distutils.command.__all__):
for
command
in
(
'upload'
,):
#
sorted(distutils.command.__all__):
bare_virtualenv
.
run
(
' && '
.
join
((
'cd {source}'
,
'python setup.py {command} -h'
,
...
...
setuptools/tests/test_wheel.py
View file @
5cd86987
...
...
@@ -63,6 +63,7 @@ WHEEL_INFO_TESTS = (
}),
)
@
pytest
.
mark
.
parametrize
(
(
'filename'
,
'info'
),
WHEEL_INFO_TESTS
,
ids
=
[
t
[
0
]
for
t
in
WHEEL_INFO_TESTS
]
...
...
@@ -487,6 +488,7 @@ WHEEL_INSTALL_TESTS = (
)
@
pytest
.
mark
.
parametrize
(
'params'
,
WHEEL_INSTALL_TESTS
,
ids
=
list
(
params
[
'id'
]
for
params
in
WHEEL_INSTALL_TESTS
),
...
...
setuptools/tests/test_windows_wrappers.py
View file @
5cd86987
...
...
@@ -97,7 +97,8 @@ class TestCLI(WrapperTester):
'arg 4
\
\
'
,
'arg5 a
\
\
\
\
b'
,
]
proc
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
)
proc
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
)
stdout
,
stderr
=
proc
.
communicate
(
'hello
\
n
world
\
n
'
.
encode
(
'ascii'
))
actual
=
stdout
.
decode
(
'ascii'
).
replace
(
'
\
r
\
n
'
,
'
\
n
'
)
expected
=
textwrap
.
dedent
(
r"""
...
...
@@ -134,7 +135,11 @@ class TestCLI(WrapperTester):
with
(
tmpdir
/
'foo-script.py'
).
open
(
'w'
)
as
f
:
f
.
write
(
self
.
prep_script
(
tmpl
))
cmd
=
[
str
(
tmpdir
/
'foo.exe'
)]
proc
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
proc
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
stdout
,
stderr
=
proc
.
communicate
()
actual
=
stdout
.
decode
(
'ascii'
).
replace
(
'
\
r
\
n
'
,
'
\
n
'
)
expected
=
textwrap
.
dedent
(
r"""
...
...
@@ -172,7 +177,9 @@ class TestGUI(WrapperTester):
str
(
tmpdir
/
'test_output.txt'
),
'Test Argument'
,
]
proc
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
proc
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
stdout
,
stderr
=
proc
.
communicate
()
assert
not
stdout
assert
not
stderr
...
...
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