Martin von Gagern <martin.vgag...@gmx.net> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11218>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to