[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2020-03-24 Thread Zbynek Winkler
Change by Zbynek Winkler : -- nosy: +Zbynek.Winkler ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2019-08-01 Thread Stefan Sullivan
Stefan Sullivan added the comment: This seems like it directly contradicts the documentation for the discover method: "If a package (a directory containing a file named __init__.py) is found, the package will be checked for a load_tests function. If this exists then it will be called packag

[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2013-04-26 Thread vila
Changes by vila : -- nosy: +vila ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman

[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2012-11-26 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2012-10-09 Thread Michael Foord
Michael Foord added the comment: Changing the docs to the following fixes the original reported issue: def load_tests(loader, standard_tests, pattern): # top level directory cached on loader instance this_dir = os.path.dirname(__file__) pattern = pattern or "test_*.py" package_te

[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2012-04-13 Thread Martin von Gagern
Martin von Gagern 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

[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2012-04-13 Thread Michael Foord
Michael Foord added the comment: Also the patch to allow the pattern to be None (and revert to the default pattern in this case) looks good. -- ___ Python tracker ___ _

[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2012-04-13 Thread Michael Foord
Michael Foord added the comment: So the logic of the "pattern" argument to "load_tests" is that it should not be None when test discovery is loading the __init__.py module of a test package. However, because most patterns will actually *prevent* __init__.py from being loaded by test discovery

[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2012-04-13 Thread Martin von Gagern
Martin von Gagern added the comment: I'm attaching a patch to better explain what I'm suggesting. As you can see, this patch doesn't change the signature of discover, nor does it change the semantics for any code that doesn't pass pattern, or that passes some pattern other than None. The onl

[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2012-04-13 Thread Rik Poggi
Rik Poggi added the comment: I wasn't trying to make any argument, just thinking that such particular signature was intentional. Also notice that there might be code that doesn't pass the pattern argument, and fall back on the default value. So a signature change will break their code. I thi

[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2012-04-09 Thread Martin von Gagern
Martin von Gagern added the comment: Rik, I don't follow your argument on not changing discover. Currently, if code calls discover with pattern=None, there will be an exception. So there cannot be any working code out there which passes pattern=None. Therefore, it should be all right for the

[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2012-04-09 Thread Rik Poggi
Rik Poggi added the comment: I think the doc should be improved (http://docs.python.org/library/unittest.html#load-tests-protocol), it's not clear how pattern in the example (last one) could not be None. Changing the discover signature doesn't seem to be an option since the TestLoader.discov

[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2011-06-14 Thread Michael Foord
Changes by Michael Foord : -- assignee: -> michael.foord ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2011-06-14 Thread Éric Araujo
Changes by Éric Araujo : -- assignee: docs@python -> components: -Documentation nosy: +eric.araujo, ezio.melotti, michael.foord -docs@python stage: -> test needed type: feature request -> behavior versions: +Python 3.2, Python 3.3 ___ Python tracke

[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2011-02-15 Thread Martin von Gagern
New submission from Martin von Gagern : If I follow the documentation at http://docs.python.org/library/unittest.html#unittest.main by putting the following two snippets of code in my module file: def load_tests(loader, standard_tests, pattern='test*.py'): # top level directory cached on l