running test suite pollutes current working dir

Bug #239097 reported by Vincent Ladeuil
2
Affects Status Importance Assigned to Milestone
Bazaar Usertest
Fix Released
Low
Vincent Ladeuil

Bug Description

Namely, each time I run 'bzr selftest', I end up with the following empty files:

.bzr.log
help.xx
singleCommand.xx

running
   'bzr selftest -s bzrlib.plugins.usertest'
also exhibits the bug

Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

Just some lazy coding from me some time ago that needs fixing.

Changed in bzr-usertest:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Vincent Ladeuil (vila) wrote :

Ran into it again.

The fix is trivial :

=== modified file 'tests/test_script.py'
--- tests/test_script.py 2008-02-06 06:55:50 +0000
+++ tests/test_script.py 2008-10-01 15:59:41 +0000
@@ -18,7 +18,7 @@
 import random
 import string

-from bzrlib.tests import TestCase
+from bzrlib.tests import TestCaseInTempDir

 from bzrlib.plugins.usertest import (
     toolprofiler,
@@ -28,7 +28,7 @@
     )

-class TestScriptTask(TestCase):
+class TestScriptTask(TestCaseInTempDir):

     def test_compile(self):
         task = userscript.ScriptTask()

In fact, it wasn't lazy coding on your part, bzrlib.test.TestCase really set HOME as os.getcwd() but all our tests relies on TestCaseInTempDir to clean after themselves.

I can't push to lp:bzr-usertest though.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 239097] Re: running test suite pollutes current working dir

On Thu, Oct 2, 2008 at 2:40 AM, vila <email address hidden> wrote:
> Ran into it again.

Well done for fixing it.

> -class TestScriptTask(TestCase):
> +class TestScriptTask(TestCaseInTempDir):
>
> def test_compile(self):
> task = userscript.ScriptTask()
>
>
> In fact, it wasn't lazy coding on your part, bzrlib.test.TestCase really set HOME as os.getcwd() but all our tests relies on TestCaseInTempDir to clean after themselves.

I think this is kind of a bug in TestCase too...

> I can't push to lp:bzr-usertest though.

I've changed the trunk for that plugin to be owned by ~bzr of which
you are a member, so you should be able to do it now.

--
Martin <http://launchpad.net/~mbp/>

Vincent Ladeuil (vila)
Changed in bzr-usertest:
assignee: nobody → vila
status: Confirmed → In Progress
Vincent Ladeuil (vila)
Changed in bzr-usertest:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.