[New-bugs-announce] [issue20484] test_pydoc can alter execution environment causing subsequent test failures
Ned Deily
report at bugs.python.org
Sun Feb 2 06:57:56 CET 2014
New submission from Ned Deily:
With the "pydoc.synopsis() for 'binary' modules" changes (d6c3fb8d5f84) to pydoc and test_pydoc for Issue20123, running test_pydoc can leave the regrtest environment altered and cause subsequent tests to fail in strange ways. I ran into this issue running regression tests for 3.4.0 and was able to isolate the failure to this change set.
A somewhat simplified (if not necessarily minimal) set of steps to reproduce follow. I've not had time to further investigate the cause. I've also only seen the problem when running the tests with an installed Python or from a build directory when there is also a Python installed in the configured prefix but not from the build directory with no Python installed at the configured prefix. I've reproduced the failure on both Debian Linux and on OS X. The following output is from the former.
$ rm -rf /tmp/root/*
$ hg purge --all
$ hg update 6d72617cae64 # the parent change set of d6c3fb8d5f84
$ hg log -r .
changeset: 88306:6d72617cae64
user: R David Murray <rdmurray at bitdance.com>
date: Sat Jan 04 21:17:52 2014 -0500
summary: whatsnew: removal of TYPE_INT64 from marshal.
$ ./configure --prefix=/tmp/root
$ make && make install
$ ( cd /tmp && /tmp/root/bin/python3.4 -m test -w test_pydoc test_distutils )
[1/2] test_pydoc
[2/2] test_distutils
All 2 tests OK.
$ hg update d6c3fb8d5f84
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg log -r .
changeset: 88307:d6c3fb8d5f84
user: Eric Snow <ericsnowcurrently at gmail.com>
date: Sat Jan 04 20:38:11 2014 -0700
summary: Issue 20123: Fix pydoc.synopsis() for "binary" modules.
$ make && make install
$ ( cd /tmp && /tmp/root/bin/python3.4 -m test -w test_pydoc test_distutils )
[1/2] test_pydoc
Warning -- warnings.filters was modified by test_pydoc
Warning -- logging._handlerList was modified by test_pydoc
[2/2] test_distutils
test test_distutils failed -- multiple errors occurred; run in verbose mode for details
1 test failed:
test_distutils
1 test altered the execution environment:
test_pydoc
Re-running failed tests in verbose mode
Re-running test 'test_distutils' in verbose mode
test_simple_built (distutils.tests.test_bdist_dumb.BuildDumbTestCase) ... FAIL
test_check_all (distutils.tests.test_check.CheckTestCase) ... ok
[...]
======================================================================
ERROR: test_metadata_check_option (distutils.tests.test_sdist.SDistTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/root/lib/python3.4/distutils/tests/test_sdist.py", line 247, in test_metadata_check_option
cmd.run()
File "/tmp/root/lib/python3.4/distutils/command/sdist.py", line 158, in run
self.get_file_list()
File "/tmp/root/lib/python3.4/distutils/command/sdist.py", line 204, in get_file_list
self.add_defaults()
File "/tmp/root/lib/python3.4/distutils/command/sdist.py", line 262, in add_defaults
self.filelist.extend(build_py.get_source_files())
File "/tmp/root/lib/python3.4/distutils/command/build_py.py", line 301, in get_source_files
return [module[-1] for module in self.find_all_modules()]
File "/tmp/root/lib/python3.4/distutils/command/build_py.py", line 295, in find_all_modules
package_dir = self.get_package_dir(package)
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/build_py.py", line 187, in get_package_dir
return os.path.join(self.distribution.src_root, res)
File "/tmp/root/lib/python3.4/posixpath.py", line 83, in join
path += b
TypeError: unsupported operand type(s) for +=: 'dict' and 'str'
======================================================================
ERROR: test_debug_mode (distutils.tests.test_install.InstallTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/root/lib/python3.4/distutils/tests/test_install.py", line 236, in test_debug_mode
self.test_record()
File "/tmp/root/lib/python3.4/distutils/tests/test_install.py", line 186, in test_record
cmd.run()
File "/tmp/root/lib/python3.4/distutils/command/install.py", line 566, in run
self.run_command(cmd_name)
File "/tmp/root/lib/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/tmp/root/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/install_scripts.py", line 18, in run
self.run_command("egg_info")
File "/tmp/root/lib/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/tmp/root/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 163, in run
self.find_sources()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 186, in find_sources
mm.run()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 246, in run
self.add_defaults()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 282, in add_defaults
sdist.add_defaults(self)
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/sdist.py", line 148, in add_defaults
if os.path.exists(fn):
File "/tmp/root/lib/python3.4/genericpath.py", line 19, in exists
os.stat(path)
TypeError: stat: can't specify None for path argument
======================================================================
ERROR: test_record (distutils.tests.test_install.InstallTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/root/lib/python3.4/distutils/tests/test_install.py", line 186, in test_record
cmd.run()
File "/tmp/root/lib/python3.4/distutils/command/install.py", line 566, in run
self.run_command(cmd_name)
File "/tmp/root/lib/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/tmp/root/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/install_scripts.py", line 18, in run
self.run_command("egg_info")
File "/tmp/root/lib/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/tmp/root/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 163, in run
self.find_sources()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 186, in find_sources
mm.run()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 246, in run
self.add_defaults()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 282, in add_defaults
sdist.add_defaults(self)
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/sdist.py", line 148, in add_defaults
if os.path.exists(fn):
File "/tmp/root/lib/python3.4/genericpath.py", line 19, in exists
os.stat(path)
TypeError: stat: can't specify None for path argument
======================================================================
ERROR: test_record_extensions (distutils.tests.test_install.InstallTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/root/lib/python3.4/distutils/tests/test_install.py", line 217, in test_record_extensions
cmd.run()
File "/tmp/root/lib/python3.4/distutils/command/install.py", line 566, in run
self.run_command(cmd_name)
File "/tmp/root/lib/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/tmp/root/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/install_egg_info.py", line 29, in run
self.run_command('egg_info')
File "/tmp/root/lib/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/tmp/root/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 163, in run
self.find_sources()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 186, in find_sources
mm.run()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 246, in run
self.add_defaults()
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 282, in add_defaults
sdist.add_defaults(self)
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/sdist.py", line 148, in add_defaults
if os.path.exists(fn):
File "/tmp/root/lib/python3.4/genericpath.py", line 19, in exists
os.stat(path)
TypeError: stat: can't specify None for path argument
======================================================================
ERROR: test_get_inputs (distutils.tests.test_install_lib.InstallLibTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/root/lib/python3.4/distutils/tests/test_install_lib.py", line 91, in test_get_inputs
inputs = cmd.get_inputs()
File "/tmp/root/lib/python3.4/distutils/command/install_lib.py", line 211, in get_inputs
inputs.extend(build_py.get_outputs())
File "/tmp/root/lib/python3.4/distutils/command/build_py.py", line 308, in get_outputs
modules = self.find_all_modules()
File "/tmp/root/lib/python3.4/distutils/command/build_py.py", line 295, in find_all_modules
package_dir = self.get_package_dir(package)
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/build_py.py", line 187, in get_package_dir
return os.path.join(self.distribution.src_root, res)
File "/tmp/root/lib/python3.4/posixpath.py", line 83, in join
path += b
TypeError: unsupported operand type(s) for +=: 'dict' and 'str'
======================================================================
ERROR: test_get_outputs (distutils.tests.test_install_lib.InstallLibTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/root/lib/python3.4/distutils/tests/test_install_lib.py", line 71, in test_get_outputs
outputs = cmd.get_outputs()
File "/tmp/root/lib/python3.4/distutils/command/install_lib.py", line 188, in get_outputs
self.install_dir)
File "/tmp/root/lib/python3.4/distutils/command/install_lib.py", line 148, in _mutate_outputs
build_files = build_cmd.get_outputs()
File "/tmp/root/lib/python3.4/distutils/command/build_py.py", line 308, in get_outputs
modules = self.find_all_modules()
File "/tmp/root/lib/python3.4/distutils/command/build_py.py", line 295, in find_all_modules
package_dir = self.get_package_dir(package)
File "/tmp/root/lib/python3.4/site-packages/setuptools/command/build_py.py", line 187, in get_package_dir
return os.path.join(self.distribution.src_root, res)
File "/tmp/root/lib/python3.4/posixpath.py", line 83, in join
path += b
TypeError: unsupported operand type(s) for +=: 'dict' and 'str'
======================================================================
FAIL: test_simple_built (distutils.tests.test_bdist_dumb.BuildDumbTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/root/lib/python3.4/distutils/tests/test_bdist_dumb.py", line 91, in test_simple_built
self.assertEqual(contents, sorted(wanted))
AssertionError: Lists differ: ['PKG-INFO', 'SOURCES.txt', 'dependency_lin[52 chars]txt'] != ['foo-0.1-py3.4.egg-info', 'foo.cpython-34.pyc', 'foo.py']
First differing element 0:
PKG-INFO
foo-0.1-py3.4.egg-info
First list contains 3 additional elements.
First extra element 3:
foo.cpython-34.pyc
+ ['foo-0.1-py3.4.egg-info', 'foo.cpython-34.pyc', 'foo.py']
- ['PKG-INFO',
- 'SOURCES.txt',
- 'dependency_links.txt',
- 'foo.cpython-34.pyc',
- 'foo.py',
- 'top_level.txt']
======================================================================
FAIL: test_formats (distutils.tests.test_bdist.BuildTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/root/lib/python3.4/distutils/tests/test_bdist.py", line 26, in test_formats
self.assertEqual(found, formats)
AssertionError: Lists differ: ['bztar', 'egg', 'gztar', 'msi', 'rpm', 'tar', 'wininst', 'zip', 'ztar'] != ['bztar', 'gztar', 'msi', 'rpm', 'tar', 'wininst', 'zip', 'ztar']
First differing element 1:
egg
gztar
First list contains 1 additional elements.
First extra element 8:
ztar
- ['bztar', 'egg', 'gztar', 'msi', 'rpm', 'tar', 'wininst', 'zip', 'ztar']
? -------
+ ['bztar', 'gztar', 'msi', 'rpm', 'tar', 'wininst', 'zip', 'ztar']
======================================================================
FAIL: test_dir_in_package_data (distutils.tests.test_build_py.BuildPyTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/root/lib/python3.4/distutils/tests/test_build_py.py", line 153, in test_dir_in_package_data
dist.run_commands()
distutils.errors.DistutilsFileError: can't copy 'pkg/doc/otherdir': doesn't exist or not a regular file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/root/lib/python3.4/distutils/tests/test_build_py.py", line 155, in test_dir_in_package_data
self.fail("failed package_data when data dir includes a dir")
AssertionError: failed package_data when data dir includes a dir
======================================================================
FAIL: test_empty_package_dir (distutils.tests.test_build_py.BuildPyTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/root/lib/python3.4/distutils/tests/test_build_py.py", line 87, in test_empty_package_dir
dist.run_commands()
distutils.errors.DistutilsFileError: can't copy 'oc/testfile': doesn't exist or not a regular file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/root/lib/python3.4/distutils/tests/test_build_py.py", line 89, in test_empty_package_dir
self.fail("failed package_data test when package_dir is ''")
AssertionError: failed package_data test when package_dir is ''
----------------------------------------------------------------------
Ran 201 tests in 0.915s
FAILED (failures=4, errors=6, skipped=19)
test test_distutils failed
$ rm -rf /tmp/root/*
$ hg purge --all
$ hg update default # current tip
339 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ hg log -r .
changeset: 88889:d7ac90c0463a
tag: tip
user: Victor Stinner <victor.stinner at gmail.com>
date: Sat Feb 01 22:49:59 2014 +0100
summary: Issue #20400: Merge Tulip into Python: add the new asyncio.subprocess module
$ ./configure --prefix=/tmp/root
$ make && make install
$ ( cd /tmp && /tmp/root/bin/python3.4 -m test -w test_pydoc test_distutils )
[1/2] test_pydoc
Warning -- warnings.filters was modified by test_pydoc
Warning -- logging._handlerList was modified by test_pydoc
[2/2] test_distutils
test test_distutils failed -- multiple errors occurred; run in verbose mode for details
1 test failed:
test_distutils
1 test altered the execution environment:
test_pydoc
Re-running failed tests in verbose mode
Re-running test 'test_distutils' in verbose mode
test_simple_built (distutils.tests.test_bdist_dumb.BuildDumbTestCase) ... FAIL
[...]
----------------------------------------------------------------------
Ran 201 tests in 0.959s
FAILED (failures=4, errors=6, skipped=19)
test test_distutils failed
$ # problem still exists
----------
assignee: eric.snow
components: Library (Lib), Tests
messages: 209950
nosy: eric.snow, ned.deily
priority: high
severity: normal
stage: needs patch
status: open
title: test_pydoc can alter execution environment causing subsequent test failures
versions: Python 3.4
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20484>
_______________________________________
More information about the New-bugs-announce
mailing list