Close #22457: Honour load_tests in the start_dir of discovery.

We were not honouring load_tests in a package/__init__.py when that was the
start_dir parameter, though we do when it is a child package. The fix required
a little care since it introduces the possibility of infinite recursion.
This commit is contained in:
Robert Collins 2014-11-05 03:09:01 +13:00
parent d39e199a0d
commit bf2bda3c97
6 changed files with 166 additions and 58 deletions

View file

@ -841,7 +841,7 @@ class Test_TestLoader(unittest.TestCase):
loader = unittest.TestLoader()
suite = loader.loadTestsFromNames(
['unittest.loader.sdasfasfasdf', 'unittest'])
['unittest.loader.sdasfasfasdf', 'unittest.test.dummy'])
error, test = self.check_deferred_error(loader, list(suite)[0])
expected = "module 'unittest.loader' has no attribute 'sdasfasfasdf'"
self.assertIn(