title: Change names of tests created by nose test generators
body: <p>Nose has a <a href="http://code.google.com/p/python-nose/issues/detail?id=244">bug</a> - test names created by generators are not cached, so the error looks like it happened in the last test, not the actual test where it failed. I got around it following the <a href="http://code.google.com/p/python-nose/issues/detail?id=244#c1">solution</a> in the bug report discussion, but it only works for names shown on stdout, not in the XML report (--with-xunit)</p>
  
  <pre><code>from functools import partial, update_wrapper
  def testGenerator():
      for i in range(10):
          func = partial(test)
          # make decorator with_setup() work again
          update_wrapper(func, test)
          func.description = "nice test name %s" % i
          yield func
  
  def test():
      pass
  </code></pre>
  
  <p>The output of nose is as expected, something like</p>
  
  <pre><code>nice test name 0 ... ok
  nice test name 1 ... ok
  nice test name 2 ... ok
  ...
  </code></pre>
  
  <p>But the test names in XML are just 'testGenerator'.</p>
  
  <pre><code>...&lt;testcase classname="example" name="testGenerator" time="0.000" /&gt;...
  </code></pre>
  
  <p><strong>How can I change this so that the personalized test names are shown on both stdout and XML output?</strong></p>
  
  <p>I'm using nosetests version 1.1.2 and Python 2.6.6</p>