Re: "finally" for unit test

2007-03-23 Thread 7stud
On Mar 23, 5:18 am, "killkolor" <[EMAIL PROTECTED]> wrote: > I have .. a single function that .. > works with files (takes input and outputs in the same file, no return > values). That function could cause problems. If your function reads in the whole file, modifies the data, and then overwrites

Re: "finally" for unit test

2007-03-23 Thread Duncan Booth
Jorgen Grahn <[EMAIL PROTECTED]> wrote: > On 23 Mar 2007 12:19:15 GMT, Duncan Booth > <[EMAIL PROTECTED]> wrote: >> "killkolor" <[EMAIL PROTECTED]> wrote: >> >>> I have a unittest framework that tests a single function that in >>> turn works with files (takes input and outputs in the same file, n

Re: "finally" for unit test

2007-03-23 Thread Jorgen Grahn
On 23 Mar 2007 12:19:15 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: > "killkolor" <[EMAIL PROTECTED]> wrote: > >> I have a unittest framework that tests a single function that in turn >> works with files (takes input and outputs in the same file, no return >> values). > > I would want to split tha

Re: "finally" for unit test

2007-03-23 Thread skip
gabriel> Is there something like a finally for unittest functions? TestCase instances have setUp() and tearDown() methods: http://docs.python.org/dev/lib/testcase-objects.html Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: "finally" for unit test

2007-03-23 Thread killkolor
I went with the TestCase.setUp() function. Thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list

Re: "finally" for unit test

2007-03-23 Thread Duncan Booth
"killkolor" <[EMAIL PROTECTED]> wrote: > I have a unittest framework that tests a single function that in turn > works with files (takes input and outputs in the same file, no return > values). I would want to split that function into two: a) one which does the processing, but not working with a

Re: "finally" for unit test

2007-03-23 Thread Peter Otten
killkolor wrote: > I have a unittest framework that tests a single function that in turn > works with files (takes input and outputs in the same file, no return > values). > In the unittest class I assign a member with all the names of my > testfiles and a testdirectory. The tests call the functio

Re: "finally" for unit test

2007-03-23 Thread Steven D'Aprano
On Fri, 23 Mar 2007 04:18:59 -0700, killkolor wrote: > The problem now is that after each testrun I have to copy "fresh" files > into the testdirectory, since of course the function already run on all > the files and made the changes. So I implemented a buffering in the > unittest functions: buffe

"finally" for unit test

2007-03-23 Thread killkolor
hi! I have a unittest framework that tests a single function that in turn works with files (takes input and outputs in the same file, no return values). In the unittest class I assign a member with all the names of my testfiles and a testdirectory. The tests call the function (which opens and writ