text: Created on 2013-01-27 10:11 by chris.jerdonek, last changed 2013-02-11 17:11 by chris.jerdonek. This issue is now closed.
  The _do_discovery() method of unittest.TestProgram:
  def _do_discovery(self, argv, Loader=loader.TestLoader):
  (from )
  should be using self.testLoader instead of loader.TestLoader. It's not consistent for some parts of TestProgram to use loader.TestLoader and other parts to use the testLoader passed in via the constructor.
  I think you're correct - although I wonder if *anyone*, *ever* will be helped by the change. :-)
  I will at least! :) I noticed the issue after trying to use unittest test discovery with a custom loader. Fortunately, there is at least this work-around (though it relies on an implementation detail):
  class MyTestProgram(unittest.TestProgram):
  # Override because of issue #17052.
  def _do_discovery(self, argv, Loader=None):
  if Loader is None:
  Loader = lambda: self.testLoader
  super(TestPizza, self)._do_discovery(argv, Loader=Loader)
  New changeset b53b029895df by Michael Foord in branch 'default':
  Merge. Closes issue 17052.
  Michael, was this implemented correctly? Loader should be a callable (e.g. a class), but self.testLoader is an instance (it defaults to loader.defaultTestLoader, which equals loader.TestLoader()):
  +- Issue #17502: unittest discovery should use self.testLoader.
  Also, this should read Issue #17052.
  I think you're right! Thanks.
  New changeset ece0a2e6b08e by Michael Foord in branch '2.7':
  Correction to issue 17052 fix
  New changeset 867763eb6985 by Michael Foord in branch '3.2':
  Correction to issue 17052 fix
  New changeset a79650aacb43 by Michael Foord in branch 'default':
  Merge. Closes issue 17052.
  Thanks a lot for taking care of this issue, Michael.