Re: [Python-Dev] [Python-checkins] cpython (3.2): test_os: add TemporaryFileTests to the testcase list
I tried to find which commit removes TemporaryFileTests from the testcase list (to see if there is a good reason to do that, or if it's just a mistake): it's somewhere between Python 2.x and Python 3.0, but I didn't find the commit. Is there a tool to detect that a testcase is never executed to ensure that there is no other forgiven testcase? Victor Le vendredi 01 juillet 2011 à 03:06 +0200, victor.stinner a écrit :
http://hg.python.org/cpython/rev/00a874ad4fc9 changeset: 71104:00a874ad4fc9 branch: 3.2 parent: 71101:7c60c1b41da9 user: Victor Stinner <victor.stinner@haypocalc.com> date: Fri Jul 01 02:56:15 2011 +0200 summary: test_os: add TemporaryFileTests to the testcase list
The testcase was never executed, it's now fixed.
files: Lib/test/test_os.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -1344,6 +1344,7 @@ PidTests, LoginTests, LinkTests, + TemporaryFileTests, )
On Fri, Jul 1, 2011 at 7:18 PM, Victor Stinner <victor.stinner@haypocalc.com> wrote:
I tried to find which commit removes TemporaryFileTests from the testcase list (to see if there is a good reason to do that, or if it's just a mistake): it's somewhere between Python 2.x and Python 3.0, but I didn't find the commit.
Is there a tool to detect that a testcase is never executed to ensure that there is no other forgiven testcase?
Coverage data for the test suite itself. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
On Fri, 2011-07-01 at 11:18 +0200, Victor Stinner wrote:
I tried to find which commit removes TemporaryFileTests from the testcase list (to see if there is a good reason to do that, or if it's just a mistake): it's somewhere between Python 2.x and Python 3.0, but I didn't find the commit.
For what it's worth, $ hg grep --all TemporaryFileTests Lib/test/test_os.py Lib/test/test_os.py:45773:+:class TemporaryFileTests(unittest.TestCase): Lib/test/test_os.py:43680:-:class TemporaryFileTests(unittest.TestCase): Lib/test/test_os.py:43680:-: TemporaryFileTests, will show where TemporaryFileTests was removed and added.
Le vendredi 01 juillet 2011 à 14:55 +0200, Ross Lagerwall a écrit :
On Fri, 2011-07-01 at 11:18 +0200, Victor Stinner wrote:
I tried to find which commit removes TemporaryFileTests from the testcase list (to see if there is a good reason to do that, or if it's just a mistake): it's somewhere between Python 2.x and Python 3.0, but I didn't find the commit.
For what it's worth,
$ hg grep --all TemporaryFileTests Lib/test/test_os.py Lib/test/test_os.py:45773:+:class TemporaryFileTests(unittest.TestCase): Lib/test/test_os.py:43680:-:class TemporaryFileTests(unittest.TestCase): Lib/test/test_os.py:43680:-: TemporaryFileTests,
will show where TemporaryFileTests was removed and added.
It was added in the middle of an horrible trunk->3.x merge: "Merged revisions 61239-61249,61252-61257,61260-61264,61269-61275,61278-61279,61285-61286,61288-61290,61298,61303-61305, svn+ssh://pythondev@svn.python.org/python/trunk" To find which commit removed a function in a file, hg bisect can be used (trick given on #mercurial): PREVREV=$(hg id); hg bisect -r; hg bisect -g 0; hg bisect -c 'grep -q tmpnam Modules/posixmodule.c'; hg update $PREVREV Even if it searchs in ~70.000 commits, it takes less than a second to find the commit which removed tmpnam in Python 3: ------------ changeset: 43680:a8818ffe24d1 parent: 43673:d66018ed3ded user: Guido van Rossum <guido@python.org> date: Thu Oct 25 23:18:51 2007 +0000 files: Doc/library/os.rst Lib/test/test_os.py Lib/test/test_posix.py Misc/NEWS Modules/posixmodule.c description: Patch 1318 by Christian Heimes: remove os.tmpnam(), os.tempnam(), and os.tmpfile(). ------------ Note: I did a new commit on test_os in Python 3.3 to remove TemporaryFileTests (again): most tests were useless because os.tmpnam(), os.tempnam() and os.tmpfile() don't exist anymore in Python 3.3. I moved remaining useful tests to another testcase. Victor
participants (3)
-
Nick Coghlan
-
Ross Lagerwall
-
Victor Stinner