[TIP] issues with class level fixtures

loigu loigu at volny.cz
Tue Oct 23 07:22:17 PDT 2007


I'm trying to set up automated testing enviroment for one project using
nose, but when I wrote just example to get familiar with nose I run into
some problems.
(So I'm new to nose, please be patient with me ;)

First problem is, that class level fixtures didn't work as I expected:

In simple class without class level fixtures everything seem o.k.
But when nose try to run test class with class level fixtures, it ends
with error (full trace in attachment):
  TypeError: unbound method setup_class() must be called with
TestClassFixtures instance as first argument (got nothing instead)

For me, this ^^^ is a bug (and I got some patches too ;)

I'm running python 2.5.1 (is this release supported?)

As attachments there is my setup:
 - testWithClassFixtures.py is test module containing two simple classes:
   TestClass with two tests (one should pass and the other fail) and
method level fixtures
   TestClassFixtures (TestClass) which adds class level fixtures

 - 0.10.0_class_test.out is output from running the test module under
release 0.10.0 of nose

 - local_class_test.out is output from running the test module under my
(patched) local branch of nose (and how I actually expect output to look

Please, tell me - it is a bug, or I'm doing something wrong?

Jiri Zouhar

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0.10.0_class_test.out
Url: http://lists.idyll.org/pipermail/testing-in-python/attachments/20071023/cc79d200/attachment.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: local_class_test.out
Url: http://lists.idyll.org/pipermail/testing-in-python/attachments/20071023/cc79d200/attachment-0001.txt 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testWithClassFixtures.py
Type: text/x-python
Size: 947 bytes
Desc: not available
Url : http://lists.idyll.org/pipermail/testing-in-python/attachments/20071023/cc79d200/attachment.py 

More information about the testing-in-python mailing list