mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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:
parent
d39e199a0d
commit
bf2bda3c97
6 changed files with 166 additions and 58 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue