[TIP] Plugin API for nose: Expanding one test case into many

Ben Finney ben+python at benfinney.id.au
Fri Jul 18 02:45:13 PDT 2008

Howdy all,

I'm working on a plugin for 'nose', called 'nose_scenario'
<URL:http://pypi.python.org/pypi/nose_scenario/>. I'm hoping to get
some help from people more knowledgeable about 'nose' that I am.

The plugin (please refer to its documentation and sample tests) is
largely working okay, but two things are causing me trouble as of
version 0.1.1 <URL:http://pypi.python.org/pypi/nose_scenario/0.1.1>:

* The application of attributes to test cases is working correctly for
  subclasses of 'unittest.TestCase', but not for other test classes.

  This can be seen in the sample tests: the 'test_unittest.py' module
  behaves correctly, but the 'test_testclass.py' module throws an
  AttributeError for every single test case.

  Why are the attributes beingapplied correctly to instances of
  'unittest.TestCase', but not other instances?

* The display of a short description for each test case should include
  the scenario id string, if that test case has one. This is currently
  *only* working for test cases that have a docstring; other test
  cases seem to ignore the custom short description hook.

  This can be seen in the sample tests: test cases with a docstring
  correctly display their scenario id, but others do not.

  How can I get the short description modified for all cases?

Thanks in advance for anyone's assistance with this. The nose
framework is powerful but making my brain hurt a little :-/

 \     “Listen: we are here on Earth to fart around. Don't let anybody |
  `\                  tell you otherwise.” —_Timequake_, Kurt Vonnegut |
_o__)                                                                  |
Ben Finney

More information about the testing-in-python mailing list