While I asked this on the Django list as it happened to be with some Django testing code, this might be a more generic Python question so I'll ask here too.

When performing unittest tests, I have a number of methods of the form

  def test_foo(self):
    data = (
      (item1, result1),
      ... #bunch of tests for fence-post errors
      )
    for test, result in data:
      self.assertEqual(process(test), result)

When I run my tests, I only get a tick for running one the one test (test_foo), not the len(data) tests that were actually performed. Is there a way for unittesting to report the number of passed-assertions rather than the number of test-methods run?

-tkc


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to