[issue16662] load_tests not invoked in package/__init__.py

2017-06-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset 22d4e8fb99b16657eabfe7f9fee2d40a5ef882f6 by Victor Stinner in branch '3.6': bpo-30813: Fix unittest when hunting refleaks (#2502) (#2505) https://github.com/python/cpython/commit/22d4e8fb99b16657eabfe7f9fee2d40a5ef882f6 -- _

[issue16662] load_tests not invoked in package/__init__.py

2017-06-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset 714afccf6e7644d21ce1a39e90bf83cb0c9a74f1 by Victor Stinner in branch '3.5': bpo-30813: Fix unittest when hunting refleaks (#2502) (#2506) https://github.com/python/cpython/commit/714afccf6e7644d21ce1a39e90bf83cb0c9a74f1 -- _

[issue16662] load_tests not invoked in package/__init__.py

2017-06-30 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +2575 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue16662] load_tests not invoked in package/__init__.py

2017-06-30 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +2571 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue16662] load_tests not invoked in package/__init__.py

2017-06-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset e4f9a2d2be42d5a2cdd624f8ed7cdf5028c5fbc3 by Victor Stinner in branch 'master': bpo-30813: Fix unittest when hunting refleaks (#2502) https://github.com/python/cpython/commit/e4f9a2d2be42d5a2cdd624f8ed7cdf5028c5fbc3 -- __

[issue16662] load_tests not invoked in package/__init__.py

2017-06-30 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +2564 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue16662] load_tests not invoked in package/__init__.py

2016-04-26 Thread STINNER Victor
STINNER Victor added the comment: > ImportError: No module named 'pytest' It looks like you must install pytest dependency. If you consider that it's really a bug in Python, please open an issue: this issue is now closed. -- ___ Python tracker

[issue16662] load_tests not invoked in package/__init__.py

2016-04-25 Thread Anthony Sottile
Anthony Sottile added the comment: I have a hunch that this fix here may be causing this: https://github.com/spotify/dh-virtualenv/issues/148 Minimally: echo 'from setuptools import setup; setup(name="demo")' > setup.py echo 'import pytest' > tests/__init__.py $ python setup.py test running t

[issue16662] load_tests not invoked in package/__init__.py

2014-11-02 Thread Ezio Melotti
Changes by Ezio Melotti : -- stage: -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue16662] load_tests not invoked in package/__init__.py

2014-10-17 Thread Robert Collins
Robert Collins added the comment: Closing as the fix to the test suite is applied. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue16662] load_tests not invoked in package/__init__.py

2014-09-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 090dc85f4226 by Benjamin Peterson in branch 'default': fix windows tests (#16662) https://hg.python.org/cpython/rev/090dc85f4226 -- ___ Python tracker

[issue16662] load_tests not invoked in package/__init__.py

2014-09-24 Thread Robert Collins
Changes by Robert Collins : Removed file: http://bugs.python.org/file36713/fix-windows-tests.patch ___ Python tracker ___ ___ Python-bugs-list

[issue16662] load_tests not invoked in package/__init__.py

2014-09-24 Thread Robert Collins
Robert Collins added the comment: bah, wrong extension to trigger review code :) -- Added file: http://bugs.python.org/file36714/fix-windows-tests.diff ___ Python tracker ___ ___

[issue16662] load_tests not invoked in package/__init__.py

2014-09-24 Thread Robert Collins
Robert Collins added the comment: Fix up the tests patch - tested on windows 7. -- Added file: http://bugs.python.org/file36713/fix-windows-tests.patch ___ Python tracker ___ ___

[issue16662] load_tests not invoked in package/__init__.py

2014-09-23 Thread Robert Collins
Robert Collins added the comment: I've managed to get a windows setup working. Its my mini-vfs which needs to be Windows aware (because the abs path of /foo is C:\\foo). I'll work up a patch tomorrowish. -- ___ Python tracker

[issue16662] load_tests not invoked in package/__init__.py

2014-09-11 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Sep 11, 2014, at 07:23 AM, STINNER Victor wrote: >The changeset d0ff527c53da5b925b61a8a70afc686ca6e05960 related to this issue >introduced a regression in test_unittest. The test now fails on >Windows. Darn. I don't have Windows handy to work out a fix. I

[issue16662] load_tests not invoked in package/__init__.py

2014-09-11 Thread STINNER Victor
STINNER Victor added the comment: The changeset d0ff527c53da5b925b61a8a70afc686ca6e05960 related to this issue introduced a regression in test_unittest. The test now fails on Windows. Example: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/5065/steps/test/logs/stdi

[issue16662] load_tests not invoked in package/__init__.py

2014-09-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 92b292d68104 by Barry Warsaw in branch 'default': A few tweaks for issue16662 based on feedback from Robert Collins. http://hg.python.org/cpython/rev/92b292d68104 -- ___ Python tracker

[issue16662] load_tests not invoked in package/__init__.py

2014-09-08 Thread Robert Collins
Robert Collins added the comment: @michael - ah I think I inverted the sense of the old parameter. It was defaulting True. So - no need to document anything extra:) -- ___ Python tracker __

[issue16662] load_tests not invoked in package/__init__.py

2014-09-08 Thread Michael Foord
Michael Foord added the comment: I agree, load_tests should be honoured even when not invoked through discovery. If that wasn't the case it was an unfortunate oversight on my part! -- ___ Python tracker __

[issue16662] load_tests not invoked in package/__init__.py

2014-09-08 Thread Robert Collins
Robert Collins added the comment: OH! One more thing I just spotted, which is that this change causes non-'discover' unittest test loading to invoke load_tests. IMO this is the Right Thing - its what I intended when I described the protocol a few years back, but we should document it, no? ---

[issue16662] load_tests not invoked in package/__init__.py

2014-09-08 Thread Robert Collins
Robert Collins added the comment: Thanks for landing this barry, there's a couple quirks with your improvements - loadTestsFromModule(mod, foo, bar) will raise a TypeError but not warn about foo the way loadTestsFromModule(mod, foo) will. Secondly, the TypeError has an off-by-one error in its

[issue16662] load_tests not invoked in package/__init__.py

2014-09-08 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue16662] load_tests not invoked in package/__init__.py

2014-09-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset d0ff527c53da by Barry Warsaw in branch 'default': - Issue #16662: load_tests() is now unconditionally run when it is present in http://hg.python.org/cpython/rev/d0ff527c53da -- nosy: +python-dev ___ Pytho

[issue16662] load_tests not invoked in package/__init__.py

2014-09-08 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: So, I think what I'm going to do is change the sig of the method to: def loadTestsFromModule(self, module, *args, pattern=None, **kws): I.e. the new `pattern` arg will be keyword-only. *args and **kws will be parsed for use_load_tests usage and a deprecat

[issue16662] load_tests not invoked in package/__init__.py

2014-09-08 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: pattern will have to be documented and accepted as official API -- ___ Python tracker ___ ___ Pytho

[issue16662] load_tests not invoked in package/__init__.py

2014-09-08 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: One thing I really do not like about Rob's last patch is that it exacerbates the documentation discrepancy for loadTestsFromModule(). As previously mentioned, use_load_tests arg was already not documented, and now the patch adds another undocumented pattern

[issue16662] load_tests not invoked in package/__init__.py

2014-09-08 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- versions: -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue16662] load_tests not invoked in package/__init__.py

2014-09-08 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- assignee: michael.foord -> barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16662] load_tests not invoked in package/__init__.py

2014-09-08 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- versions: +Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue16662] load_tests not invoked in package/__init__.py

2014-08-27 Thread Robert Collins
Robert Collins added the comment: The doc part of the patch was assuming this would be in 3.4 which it wasn't. Updated to 3.5. Also found a corner case - when packages were imported the _get_module_from_name method was not guarded for un-importable modules. This is strictly a separate issue, b

[issue16662] load_tests not invoked in package/__init__.py

2014-08-26 Thread Robert Collins
Robert Collins added the comment: Ok, implementation I'm happy with is up in https://bitbucket.org/rbtcollins/cpython/commits/bbf2eb26dda8f3538893bf3dc33154089f37f99d -- hgrepos: +269 Added file: http://bugs.python.org/file36482/16662_passing_tests.diff

[issue16662] load_tests not invoked in package/__init__.py

2014-08-26 Thread Robert Collins
Robert Collins added the comment: I think we rather need a test that using a load_tests hook to recursively load and transform a subdir works. Hacking on that now. -- ___ Python tracker ___

[issue16662] load_tests not invoked in package/__init__.py

2013-10-18 Thread Michael Foord
Michael Foord added the comment: use_load_tests was deliberately undocumented. IIRC it only exists to allow us to load tests from a package module (__init__.py) without invoking load_tests - it maybe that it can just go away altogether now. I'll need to look at the code to confirm. -

[issue16662] load_tests not invoked in package/__init__.py

2013-10-18 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On the second failure, the expected output just needs to be updated. Is that the right thing to do? -- ___ Python tracker ___ ___

[issue16662] load_tests not invoked in package/__init__.py

2013-10-18 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: The failure in test_discovery.py is odd. It's failing because loadTestsFromModule() is being passed a keyword arguemnt use_load_tests=False. On the surface, the failure makes sense because if you look in test_discover.py, it's defining a lambda for loader.lo

[issue16662] load_tests not invoked in package/__init__.py

2013-09-07 Thread Michael Foord
Michael Foord added the comment: I get a couple of test failures with this patch applied: == ERROR: test_find_tests (unittest.test.test_discovery.TestDiscovery) ---

[issue16662] load_tests not invoked in package/__init__.py

2013-09-03 Thread Zachary Ware
Zachary Ware added the comment: I took a stab at the doc changes, attached here and including Barry's patch. -- components: +Library (Lib) type: -> enhancement versions: +Python 3.4 Added file: http://bugs.python.org/file31575/16662_with_doc.diff ___

[issue16662] load_tests not invoked in package/__init__.py

2013-08-01 Thread Michael Foord
Michael Foord added the comment: I'm happy with the check being removed. The old behaviour was documented I believe - so there'd need to be documentation changes to go with it. As the old behaviour is so "un-useful" I don't think there are backward compatibility issues with changing it. -

[issue16662] load_tests not invoked in package/__init__.py

2013-07-31 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Seems like this patch does the trick for my very limited testing. -- keywords: +patch Added file: http://bugs.python.org/file31102/16662.diff ___ Python tracker __

[issue16662] load_tests not invoked in package/__init__.py

2013-07-31 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Hah, I just ran into this too. I was perplexed why my load_tests() function wasn't being called and ended up pdb'ing unittest's discover, and found exactly this problem. I'm not surprised lifeless beat me to it. (My use case was to piggyback on load_tests()

[issue16662] load_tests not invoked in package/__init__.py

2013-06-19 Thread Zachary Ware
Changes by Zachary Ware : -- nosy: +zach.ware ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue16662] load_tests not invoked in package/__init__.py

2013-06-12 Thread Michael Foord
Michael Foord added the comment: I agree that load_tests *should* be used in packages and that not doing this from the start was a mistake. -- ___ Python tracker ___ ___

[issue16662] load_tests not invoked in package/__init__.py

2013-06-12 Thread Michael Foord
Changes by Michael Foord : -- assignee: -> michael.foord nosy: +michael.foord ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue16662] load_tests not invoked in package/__init__.py

2013-05-28 Thread Leo Arias
Changes by Leo Arias : -- nosy: +elopio ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/

[issue16662] load_tests not invoked in package/__init__.py

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

[issue16662] load_tests not invoked in package/__init__.py

2012-12-11 Thread Robert Collins
Robert Collins added the comment: I have a package with tests in it. If the tests match test*.py, they are loaded, and load_tests within each one called. But load_tests on the package isn't called. If I change the pattern supplied by the user to match the package, then the tests within adjace

[issue16662] load_tests not invoked in package/__init__.py

2012-12-11 Thread Chris Jerdonek
Chris Jerdonek added the comment: I think he's saying that a test package will never be discovered by default, because the default value of discover()'s pattern argument is test*.py: http://hg.python.org/cpython/file/bc322469a7a8/Lib/unittest/loader.py#l152 So I think he wants package director

[issue16662] load_tests not invoked in package/__init__.py

2012-12-11 Thread R. David Murray
R. David Murray added the comment: test_email is a package, and has a load_tests in its __init__.py that I had to add in order to make "python -m unittest test.test_email" work. So I'm not sure what bug you are reporting here. -- nosy: +r.david.murray

[issue16662] load_tests not invoked in package/__init__.py

2012-12-11 Thread Robert Collins
New submission from Robert Collins: In loader.py: if fnmatch(path, pattern): # only check load_tests if the package directory itself matches the filter name = self._get_name_from_path(full_path) package = self._get_modul