Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Neal Norwitz
On Thu, Feb 21, 2008 at 7:43 AM, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > > I have usually seen a lot of tests implemented like this: > > from test.test_support import TESTFN, unlink > import unittest > > class TestCase(unittest.TestCase): > > def setUp(self): > self.file = No

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Jonathan Lange
On Fri, Feb 22, 2008 at 2:43 AM, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > On 21 Feb, 12:30, "Virgil Dupras" <[EMAIL PROTECTED]> wrote: > > Hi devs, > > > > > > Specifically, I'd like to know about files managements in tests. Is > > every test expected to clean after itself, or is there an

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Brett Cannon
On Thu, Feb 21, 2008 at 7:43 AM, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > On 21 Feb, 12:30, "Virgil Dupras" <[EMAIL PROTECTED]> wrote: > > Hi devs, > > > > > > Specifically, I'd like to know about files managements in tests. Is > > every test expected to clean after itself, or is there an

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Christian Heimes
Guido van Rossum wrote: >> I don't think so. >> You could create a directory in setUp method by using tempfile.mkdtemp >> and then remove it in tearDown. > > Specifically, clean it up with shutil.rmtree() And make sure you have closed all files before you rmtree() the directory. Otherwise the

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Virgil Dupras
On 2/21/08, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Virgil Dupras wrote: > > On 2/21/08, Virgil Dupras <[EMAIL PROTECTED]> wrote: > >> Hi devs, > >> > >> Being a python dev newbie, I look in http://www.python.org/dev/ for > >> some guide to write unit tests in python and I can't find any.

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Nick Coghlan
Virgil Dupras wrote: > On 2/21/08, Virgil Dupras <[EMAIL PROTECTED]> wrote: >> Hi devs, >> >> Being a python dev newbie, I look in http://www.python.org/dev/ for >> some guide to write unit tests in python and I can't find any. >> Specifically, I'd like to know about files managements in tests.

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Guido van Rossum
On Thu, Feb 21, 2008 at 7:43 AM, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > On 21 Feb, 12:30, "Virgil Dupras" <[EMAIL PROTECTED]> wrote: > > Hi devs, > > > > > > Specifically, I'd like to know about files managements in tests. Is > > every test expected to clean after itself, or is there an

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Giampaolo Rodola'
On 21 Feb, 12:30, "Virgil Dupras" <[EMAIL PROTECTED]> wrote: > Hi devs, > > Specifically, I'd like to know about files managements in tests. Is > every test expected to clean after itself, or is there an automatic > cleanup mechanism in place? I have usually seen a lot of tests implemented like t

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Virgil Dupras
On 2/21/08, Virgil Dupras <[EMAIL PROTECTED]> wrote: > Hi devs, > > Being a python dev newbie, I look in http://www.python.org/dev/ for > some guide to write unit tests in python and I can't find any. > Specifically, I'd like to know about files managements in tests. Is > every test expected to

[Python-Dev] Unit Test Guide

2008-02-21 Thread Virgil Dupras
Hi devs, Being a python dev newbie, I look in http://www.python.org/dev/ for some guide to write unit tests in python and I can't find any. Specifically, I'd like to know about files managements in tests. Is every test expected to clean after itself, or is there an automatic cleanup mechanism in p