At 10:16 AM 2/26/2010 -0500, Olemis Lang wrote:
Well not as happily as I thought in first place. The fact is that
`setuptools` test command creates the runner by calling the class
specified in `test_runner` arg but supplies no parameters. In this
case I'd like to specify `xmlrunner:XMLTestRunner` (is that the
correct syntax ?) to obtain a JUnit XML report, but I need to specify
the path where those reports will be outputted, so that the CI tool
(Hudson in this case) can publish'em and generate the nice graphs we
all love . Considering the current implementation, I still need to
override `run_tests` method as a whole, and repeat 99% of what is
implemented in there, in order to get the exact runner I need

:(

My suggestion (hint, $0.02 ... whatever ;o) is

   1. use a factory method (e.g `create_runner` ) returning an
     instance of  test runner. This method could be overridden by
     subclasses if further options or whatever needs to be considered
     to instanciate the runner

I'm confused. Why don't you just set test_runner to point to your factory function, then? That's what nose does. (Well, in its case it's the test_loader, but same basic idea.)

_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to