[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed versions: +Python 3.1 ___ Python tracker ___ _

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3cbbb2a7c56d by Ezio Melotti in branch '2.7': #11910: Fix test_heapq to skip the C tests when _heapq is missing. http://hg.python.org/cpython/rev/3cbbb2a7c56d New changeset 677ee366c9f5 by Ezio Melotti in branch '3.1': #11910: Fix test_heapq to ski

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3ab1eb027856 by Ezio Melotti in branch '3.1': #11910: change import_fresh_module to return None when one of the "fresh" modules can not be imported. http://hg.python.org/cpython/rev/3ab1eb027856 New changeset 754bafe8db5f by Ezio Melotti in branch

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset c1a12a308c5b by Ezio Melotti in branch '2.7': #11910: change import_fresh_module to return None when one of the "fresh" modules can not be imported. http://hg.python.org/cpython/rev/c1a12a308c5b -- nosy: +python-dev __

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-08 Thread Ezio Melotti
Ezio Melotti added the comment: BTW, if the fix for import_fresh_module is OK, it should be committed separately. The tests I added to check that the C functions are really C functions could stay in test_heapq or they could be moved to test_test_support (see #11049), possibly together with te

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-08 Thread Ezio Melotti
Ezio Melotti added the comment: Attached a patch that fixes import_fresh_module to return None when _heapq is missing and skips the C test when _heapq is missing. I also added an additional test to verify that the functions in c_heapq are really C functions and the ones in py_heapq are really

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Attaching a rough draft of a way to simplify dual path testing. The idea is that the suite shouldn't have to be rewritten with self.module.heapify(...) references throughout. Instead, tests are written normally and the only thing that changes in the cont

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-07 Thread Ezio Melotti
Ezio Melotti added the comment: Thanks (for the record the changeset is a8b82c283524). > Overall, I don't think the current approach to testing both paths > is elegant. That's the most elegant way we have now. If all the Python tests pass for the C version too, a base class could be avoided a

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm imagining a cleaner testing style, like this: class TestHeap(unittest.TestCase): def test_nsmallest(self): self.assertEqual(heapq.nsmallest(3, range(10)), [0,1,2]) ... @test_support.requires('_heapq') def test_comparison_ope

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Some of the tests were incorrectly marked as being C specific. I've fixed that on the 2.7 branch. Re-assigning back to Ezio. Overall, I don't think the current approach to testing both paths is elegant. Is there some alternative approach to running suit

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-07 Thread Ezio Melotti
Ezio Melotti added the comment: If they are not C specific they should be moved to the base class (TestHeap). TestHeapC and TestHeapPython should contain only tests specific to the C and Python versions respectively. The goal here is to make sure that they are run once with the Python versio

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Are you sure those tests are C specific? Please be careful about doing unnecessary complexification of this module's tests. -- assignee: ezio.melotti -> rhettinger nosy: +rhettinger ___ Python tracker

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-05-07 Thread Ezio Melotti
Ezio Melotti added the comment: Attempting to fix import_fresh_module might be better. -- assignee: -> ezio.melotti ___ Python tracker ___ _

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-04-24 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Patch seems good. Ezio, can you commit?. -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-lis

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-04-22 Thread Ezio Melotti
Changes by Ezio Melotti : -- components: +Tests nosy: +brett.cannon stage: -> patch review type: -> behavior versions: +Python 2.7, Python 3.2, Python 3.3 ___ Python tracker __

[issue11910] test_heapq C tests are not skipped when _heapq is missing

2011-04-22 Thread Ezio Melotti
New submission from Ezio Melotti : When _heapq is missing, test_heapq still runs both the Py and the C tests instead of skipping the C ones. The attached patch skips the C tests when _heapq is missing. -- files: issue11910.diff keywords: patch messages: 134293 nosy: ezio.melotti prior