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
3f5f4366
Commit
3f5f4366
authored
Dec 18, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #19492: Silently skipped distutils tests now reported as skipped.
parents
0ce3e9d8
3c02ecef
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
63 deletions
+36
-63
Lib/distutils/tests/test_bdist_rpm.py
Lib/distutils/tests/test_bdist_rpm.py
+17
-23
Lib/distutils/tests/test_build_clib.py
Lib/distutils/tests/test_build_clib.py
+2
-5
Lib/distutils/tests/test_build_ext.py
Lib/distutils/tests/test_build_ext.py
+2
-6
Lib/distutils/tests/test_check.py
Lib/distutils/tests/test_check.py
+2
-4
Lib/distutils/tests/test_config_cmd.py
Lib/distutils/tests/test_config_cmd.py
+1
-2
Lib/distutils/tests/test_sdist.py
Lib/distutils/tests/test_sdist.py
+8
-12
Lib/distutils/tests/test_sysconfig.py
Lib/distutils/tests/test_sysconfig.py
+3
-6
Lib/distutils/tests/test_unixccompiler.py
Lib/distutils/tests/test_unixccompiler.py
+1
-5
No files found.
Lib/distutils/tests/test_bdist_rpm.py
View file @
3f5f4366
...
...
@@ -43,18 +43,15 @@ class BuildRpmTestCase(support.TempdirManager,
sys
.
argv
[:]
=
self
.
old_sys_argv
[
1
]
super
(
BuildRpmTestCase
,
self
).
tearDown
()
def
test_quiet
(
self
):
# XXX I am unable yet to make this test work without
# spurious sdtout/stderr output under Mac OS X
if
not
sys
.
platform
.
startswith
(
'linux'
):
return
# this test will run only if the rpm commands are found
if
(
find_executable
(
'rpm'
)
is
None
or
find_executable
(
'rpmbuild'
)
is
None
):
return
@
unittest
.
skipUnless
(
sys
.
platform
.
startswith
(
'linux'
),
'spurious sdtout/stderr output under Mac OS X'
)
@
unittest
.
skipIf
(
find_executable
(
'rpm'
)
is
None
,
'the rpm command is not found'
)
@
unittest
.
skipIf
(
find_executable
(
'rpmbuild'
)
is
None
,
'the rpmbuild command is not found'
)
def
test_quiet
(
self
):
# let's create a package
tmp_dir
=
self
.
mkdtemp
()
pkg_dir
=
os
.
path
.
join
(
tmp_dir
,
'foo'
)
...
...
@@ -87,19 +84,16 @@ class BuildRpmTestCase(support.TempdirManager,
self
.
assertIn
((
'bdist_rpm'
,
'any'
,
'dist/foo-0.1-1.src.rpm'
),
dist
.
dist_files
)
self
.
assertIn
((
'bdist_rpm'
,
'any'
,
'dist/foo-0.1-1.noarch.rpm'
),
dist
.
dist_files
)
def
test_no_optimize_flag
(
self
):
# XXX I am unable yet to make this test work without
# spurious sdtout/stderr output under Mac OS X
if
not
sys
.
platform
.
startswith
(
'linux'
):
return
@
unittest
.
skipUnless
(
sys
.
platform
.
startswith
(
'linux'
),
'spurious sdtout/stderr output under Mac OS X'
)
# http://bugs.python.org/issue1533164
# this test will run only if the rpm command is found
if
(
find_executable
(
'rpm'
)
is
None
or
find_executable
(
'rpmbuild'
)
is
None
):
return
@
unittest
.
skipIf
(
find_executable
(
'rpm'
)
is
None
,
'the rpm command is not found'
)
@
unittest
.
skipIf
(
find_executable
(
'rpmbuild'
)
is
None
,
'the rpmbuild command is not found'
)
def
test_no_optimize_flag
(
self
):
# let's create a package that brakes bdist_rpm
tmp_dir
=
self
.
mkdtemp
()
pkg_dir
=
os
.
path
.
join
(
tmp_dir
,
'foo'
)
...
...
Lib/distutils/tests/test_build_clib.py
View file @
3f5f4366
...
...
@@ -102,11 +102,8 @@ class BuildCLibTestCase(support.TempdirManager,
cmd
.
distribution
.
libraries
=
'WONTWORK'
self
.
assertRaises
(
DistutilsSetupError
,
cmd
.
finalize_options
)
@
unittest
.
skipIf
(
sys
.
platform
==
'win32'
,
"can't test on Windows"
)
def
test_run
(
self
):
# can't test on windows
if
sys
.
platform
==
'win32'
:
return
pkg_dir
,
dist
=
self
.
create_dist
()
cmd
=
build_clib
(
dist
)
...
...
@@ -131,7 +128,7 @@ class BuildCLibTestCase(support.TempdirManager,
if
ccmd
is
None
:
continue
if
find_executable
(
ccmd
[
0
])
is
None
:
return
# can't test
self
.
skipTest
(
'The %r command is not found'
%
ccmd
[
0
])
# this should work
cmd
.
run
()
...
...
Lib/distutils/tests/test_build_ext.py
View file @
3f5f4366
...
...
@@ -61,9 +61,9 @@ class BuildExtTestCase(TempdirManager,
sys
.
stdout
=
old_stdout
if
ALREADY_TESTED
:
return
self
.
skipTest
(
'Already tested in %s'
%
ALREADY_TESTED
)
else
:
ALREADY_TESTED
=
True
ALREADY_TESTED
=
type
(
self
).
__name__
import
xx
...
...
@@ -113,10 +113,6 @@ class BuildExtTestCase(TempdirManager,
self
.
assertGreater
(
len
(
cmd
.
library_dirs
),
0
)
def
test_user_site
(
self
):
# site.USER_SITE was introduced in 2.6
if
sys
.
version
<
'2.6'
:
return
import
site
dist
=
Distribution
({
'name'
:
'xx'
})
cmd
=
build_ext
(
dist
)
...
...
Lib/distutils/tests/test_check.py
View file @
3f5f4366
...
...
@@ -55,9 +55,8 @@ class CheckTestCase(support.LoggingSilencer,
cmd
=
self
.
_run
(
metadata
)
self
.
assertEqual
(
cmd
.
_warnings
,
0
)
@
unittest
.
skipUnless
(
HAS_DOCUTILS
,
"won't test without docutils"
)
def
test_check_document
(
self
):
if
not
HAS_DOCUTILS
:
# won't test without docutils
return
pkg_info
,
dist
=
self
.
create_dist
()
cmd
=
check
(
dist
)
...
...
@@ -71,9 +70,8 @@ class CheckTestCase(support.LoggingSilencer,
msgs
=
cmd
.
_check_rst_data
(
rest
)
self
.
assertEqual
(
len
(
msgs
),
0
)
@
unittest
.
skipUnless
(
HAS_DOCUTILS
,
"won't test without docutils"
)
def
test_check_restructuredtext
(
self
):
if
not
HAS_DOCUTILS
:
# won't test without docutils
return
# let's see if it detects broken rest in long_description
broken_rest
=
'title
\
n
===
\
n
\
n
test'
pkg_info
,
dist
=
self
.
create_dist
(
long_description
=
broken_rest
)
...
...
Lib/distutils/tests/test_config_cmd.py
View file @
3f5f4366
...
...
@@ -37,9 +37,8 @@ class ConfigTestCase(support.LoggingSilencer,
dump_file
(
this_file
,
'I am the header'
)
self
.
assertEqual
(
len
(
self
.
_logs
),
numlines
+
1
)
@
unittest
.
skipIf
(
sys
.
platform
==
'win32'
,
"can't test on Windows"
)
def
test_search_cpp
(
self
):
if
sys
.
platform
==
'win32'
:
return
pkg_dir
,
dist
=
self
.
create_dist
()
cmd
=
config
(
dist
)
...
...
Lib/distutils/tests/test_sdist.py
View file @
3f5f4366
...
...
@@ -131,13 +131,11 @@ class SDistTestCase(PyPIRCCommandTestCase):
self
.
assertEqual
(
len
(
content
),
4
)
@
unittest
.
skipUnless
(
ZLIB_SUPPORT
,
'Need zlib support to run'
)
@
unittest
.
skipIf
(
find_executable
(
'tar'
)
is
None
,
"The tar command is not found"
)
@
unittest
.
skipIf
(
find_executable
(
'gzip'
)
is
None
,
"The gzip command is not found"
)
def
test_make_distribution
(
self
):
# check if tar and gzip are installed
if
(
find_executable
(
'tar'
)
is
None
or
find_executable
(
'gzip'
)
is
None
):
return
# now building a sdist
dist
,
cmd
=
self
.
get_cmd
()
...
...
@@ -433,13 +431,11 @@ class SDistTestCase(PyPIRCCommandTestCase):
@
unittest
.
skipUnless
(
zlib
,
"requires zlib"
)
@
unittest
.
skipUnless
(
UID_GID_SUPPORT
,
"Requires grp and pwd support"
)
@
unittest
.
skipIf
(
find_executable
(
'tar'
)
is
None
,
"The tar command is not found"
)
@
unittest
.
skipIf
(
find_executable
(
'gzip'
)
is
None
,
"The gzip command is not found"
)
def
test_make_distribution_owner_group
(
self
):
# check if tar and gzip are installed
if
(
find_executable
(
'tar'
)
is
None
or
find_executable
(
'gzip'
)
is
None
):
return
# now building a sdist
dist
,
cmd
=
self
.
get_cmd
()
...
...
Lib/distutils/tests/test_sysconfig.py
View file @
3f5f4366
...
...
@@ -80,12 +80,9 @@ class SysconfigTestCase(support.EnvironGuard, unittest.TestCase):
os
.
chdir
(
cwd
)
self
.
assertEqual
(
srcdir
,
srcdir2
)
@
unittest
.
skipUnless
(
get_default_compiler
()
==
'unix'
,
'not testing if default compiler is not unix'
)
def
test_customize_compiler
(
self
):
# not testing if default compiler is not unix
if
get_default_compiler
()
!=
'unix'
:
return
os
.
environ
[
'AR'
]
=
'my_ar'
os
.
environ
[
'ARFLAGS'
]
=
'-arflags'
...
...
@@ -151,7 +148,7 @@ class SysconfigTestCase(support.EnvironGuard, unittest.TestCase):
import
sysconfig
as
global_sysconfig
if
sysconfig
.
get_config_var
(
'CUSTOMIZED_OSX_COMPILER'
):
return
self
.
skipTest
(
'compiler flags customized'
)
self
.
assertEqual
(
global_sysconfig
.
get_config_var
(
'LDSHARED'
),
sysconfig
.
get_config_var
(
'LDSHARED'
))
self
.
assertEqual
(
global_sysconfig
.
get_config_var
(
'CC'
),
...
...
Lib/distutils/tests/test_unixccompiler.py
View file @
3f5f4366
...
...
@@ -21,12 +21,8 @@ class UnixCCompilerTestCase(unittest.TestCase):
sys
.
platform
=
self
.
_backup_platform
sysconfig
.
get_config_var
=
self
.
_backup_get_config_var
@
unittest
.
skipIf
(
sys
.
platform
==
'win32'
,
"can't test on Windows"
)
def
test_runtime_libdir_option
(
self
):
# not tested under windows
if
sys
.
platform
==
'win32'
:
return
# Issue#5900
#
# Ensure RUNPATH is added to extension modules with RPATH if
...
...
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