[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2013-01-02 Thread Brett Cannon
Brett Cannon added the comment: Why remove the refleak tests? I'm sure Raymond put those in for a reason as I know he tries to reuse various objects a lot and this helped make sure he didn't mess anything up. I don't think the tests need to be backported. --

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2013-01-02 Thread Ezio Melotti
Ezio Melotti added the comment: Why remove the refleak tests? Because regrtest already provides the feature, so I don't see a reason to duplicate it here. FWIW the same code is copy/pasted elsewhere too, e.g. in Lib/test/test_operator.py:438. --

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2013-01-02 Thread Brett Cannon
Brett Cannon added the comment: The patch LGTM -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16748 ___ ___ Python-bugs-list mailing list

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2013-01-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 008bac4e181c by Ezio Melotti in branch '3.3': #16748: test_heapq now works with unittest test discovery. http://hg.python.org/cpython/rev/008bac4e181c New changeset de6bac0a40cc by Ezio Melotti in branch 'default': #16748: merge with 3.3.

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2013-01-02 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the review! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed versions: -Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2013-01-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As I mentioned above, not only test_heapq uses this idiom, but a lot of other tests. Try to fix hard cases first: test_genericpath and test_functools. -- status: closed - open ___ Python tracker

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2013-01-01 Thread Ezio Melotti
Ezio Melotti added the comment: I just came across the problem described here while reviewing #16694. The idiom I used for the JSON tests[0] (and possibly a couple of other tests) when I rewrote them was to have something like: class FooTest: # all the test methods here class

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2013-01-01 Thread Brett Cannon
Brett Cannon added the comment: I created http://bugs.python.org/issue16835 to remind me to update PEP 399. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16748 ___

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2013-01-01 Thread Ezio Melotti
Ezio Melotti added the comment: Attached patch fixes Lib/test/test_heapq.py. I also replaced the test_main() with unittest.main() and got rid of the code previously used to test reference leaks. As it is the patch can be applied on 3.3/default. If you think it should be backported to 2.7/3.2

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2012-12-28 Thread Brett Cannon
Brett Cannon added the comment: Making tests discoverable allows for the future possibility of dropping our custom test runner code and using more of unittest code by having regrtest use unittest's discovery code to find all tests. -- ___ Python

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2012-12-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: I should think that the first fix should be to the PEP. If I understand msg177908, that would mean removing unittest.TestCase as a base for ExampleTest and adding it as bases for AcceleratedExampleTest and PyExampleTest. Or have I missed something?

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2012-12-28 Thread R. David Murray
R. David Murray added the comment: That sounds right to me. Note that PEP 399 is following older conventions that were laid down in a time when unittest did not *have* test discovery, so this is a new paradigm we'd like to move to (for the reasons Brett mentioned), and it may take a while to

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2012-12-25 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16748 ___ ___

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2012-12-25 Thread Stefan Krah
Stefan Krah added the comment: Perhaps I misunderstood something, but test_decimal.py *is* using the exact idiom from PEP-399 and it works. Why do you want to fix the usage of this idiom? -- nosy: +skrah ___ Python tracker rep...@bugs.python.org

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2012-12-25 Thread Stefan Krah
Stefan Krah added the comment: I finally understood the issue. So this does not work: ./python -m unittest discover Lib/test/ 'test_dec*.py' Neither does this: ./python -m unittest discover Lib/test/ 'test_multipro*.py' And this fails, too (still hanging): ./python -m unittest

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2012-12-24 Thread Éric Araujo
Éric Araujo added the comment: I won’t be online for the next two weeks. I think there is a bug with Michael Foord, RDM and I where we talk about this very issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16748

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2012-12-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No need to add this trivial class to test.support. Mixin can have different parameters in additional to 'module' (see 16659). I found a lot of usages of this idiom in tests and some of them can't be changed so simple (for example test_genericpath and

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2012-12-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Éric, can you submit a test which exposes the problem? -- stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16748 ___

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2012-12-21 Thread Zachary Ware
New submission from Zachary Ware: As pointed out by Éric Araujo in msg177908 of issue16694, tests using the idiom presented in PEP 399 are subject to breakage of test discovery. This issue's goal is to root out and fix all usages of this idiom. So far, only test_heapq is known to be

[issue16748] Ensure test discovery doesn't break for modules testing C and Python implementations

2012-12-21 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- nosy: +brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16748 ___ ___ Python-bugs-list