[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:

[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

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

2013-04-26 Thread vila
Changes by vila v.ladeuil+bugs-pyt...@free.fr: -- nosy: +vila ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11218 ___ ___ Python-bugs-list mailing

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

2012-11-26 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11218 ___ ___

[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

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

2012-04-13 Thread Rik Poggi
Rik Poggi poggi.ri...@gmail.com 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

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

2012-04-13 Thread Martin von Gagern
Martin von Gagern martin.vgag...@gmx.net 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

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

2012-04-13 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk 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

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

2012-04-13 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk 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 rep...@bugs.python.org http://bugs.python.org/issue11218

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

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

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

2012-04-09 Thread Rik Poggi
Rik Poggi poggi.ri...@gmail.com 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

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

2012-04-09 Thread Martin von Gagern
Martin von Gagern martin.vgag...@gmx.net 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

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

2011-06-14 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- 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

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

2011-06-14 Thread Michael Foord
Changes by Michael Foord mich...@voidspace.org.uk: -- assignee: - michael.foord ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11218 ___ ___

[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 martin.vgag...@gmx.net: 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