Title: regrtest runtest_inner calls findtestdir unnecessarily
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.2
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: r.david.murray Nosy List: r.david.murray
Priority: low Keywords: patch

Created on 2009-10-04 19:41 by r.david.murray, last changed 2010-12-27 20:11 by r.david.murray. This issue is now closed.

File name Uploaded Description Edit
remove_testdir_from_runtest_inner.patch r.david.murray, 2009-10-04 19:41
remove_testdir_from_runtest.patch r.david.murray, 2009-10-04 19:42
Messages (3)
msg93557 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-10-04 19:41
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

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.)
msg93558 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-10-04 19:42
second patch
msg124729 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-27 20:11
Committed (redid, actually) 2nd patch in r87516.  I may or may not backport it.
Date User Action Args
2010-12-27 20:11:31r.david.murraysetstatus: open -> closed
versions: - Python 2.6, Python 3.1, Python 2.7
messages: + msg124729

resolution: fixed
stage: patch review -> resolved
2009-12-13 16:37:11r.david.murraysetassignee: r.david.murray
2009-10-04 19:42:27r.david.murraysetfiles: + remove_testdir_from_runtest.patch

messages: + msg93558
2009-10-04 19:41:48r.david.murraycreate