This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gagern
Recipients eric.araujo, ezio.melotti, gagern, michael.foord, rik.poggi
Date 2012-04-13.21:23:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334352219.6.0.147174308092.issue11218@psf.upfronthosting.co.za>
In-reply-to
Content
Michael wrote: "[…] the real pattern being passed in".
I wonder, what would be "the real pattern"? In the code I originally pasted, the load_tests function would be invoked by loadTestsFromModule (for module __main__). There is nothing file-based about this, so although you could pass a default pattern, it wouldn't be any more or less "real" than passing None. It might be more useful, though.

"most patterns will actually *prevent* __init__.py from being loaded by test discovery - this turns out to not be very useful and in all practical cases this argument will be None."

Not sure I follow there. For the root of the test suite, yes, it will always be None. But for child packages it will be the pattern that led to the discovery of the __init__.py of that package. In all practical cases this will be a string different from both None and the default of 'test*.py', as it has to match the directory name. Most likely it will be what the load_tests function of the parent package passed to its invocation of discover.
History
Date User Action Args
2012-04-13 21:23:39gagernsetrecipients: + gagern, ezio.melotti, eric.araujo, michael.foord, rik.poggi
2012-04-13 21:23:39gagernsetmessageid: <1334352219.6.0.147174308092.issue11218@psf.upfronthosting.co.za>
2012-04-13 21:23:39gagernlinkissue11218 messages
2012-04-13 21:23:38gagerncreate