[New-bugs-announce] [issue7056] regrtest runtest_inner calls findtestdir unnecessarily

R. David Murray report at bugs.python.org
Sun Oct 4 21:41:50 CEST 2009


New submission from R. David Murray <rdmurray at bitdance.com>:

Running regrtest over an installed, read-only Lib produces several test
failures, and regrtest crashes.  In investigating these, which I will
deal with in other issues, I found that the regrtest runtest_inner
method takes a 'testdir' argument, and if it is none calls
'findtestdir'.  findtestdir uses __file__ or arg[0] to compute the
directory in which regrtest is located, something that does not change
during the lifetime of a given regrtest run, so at best these repeated
calls are redundant.  At worst, it triggered the regrtest abort because
the value of arg[0] was changed by one of the tests.

As it turns out, the testdir argument is never actually referenced in
the body of runtest_inner.  runtest_inner in turn is called only by
runtest, which uses _its_ testdir argument only in the call to
runtest_inner.

Attached are two patches.  The first just removes testdir from
runtest_inner, the second removes it from runtest as well.  On my Gentoo
linux box the full (-uall) test suite passes with either patch applied.
 (With the exception of test_ttk_guionly, which failed before the patch
at as well.)

----------
components: Tests
files: remove_testdir_from_runtest_inner.patch
keywords: patch
messages: 93557
nosy: r.david.murray
priority: low
severity: normal
stage: patch review
status: open
title: regrtest runtest_inner calls findtestdir unnecessarily
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file15041/remove_testdir_from_runtest_inner.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7056>
_______________________________________


More information about the New-bugs-announce mailing list