Ezio Melotti ezio.melo...@gmail.com 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
Ezio Melotti ezio.melo...@gmail.com 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),
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ncoghlan
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11910
___
___
Python-bugs-list
Roundup Robot devnull@devnull 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
Roundup Robot devnull@devnull 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
Roundup Robot devnull@devnull 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
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
versions: +Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11910
Ezio Melotti ezio.melo...@gmail.com added the comment:
Attempting to fix import_fresh_module might be better.
--
assignee: - ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11910
Raymond Hettinger raymond.hettin...@gmail.com 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
Ezio Melotti ezio.melo...@gmail.com 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
Raymond Hettinger raymond.hettin...@gmail.com 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')
Raymond Hettinger raymond.hettin...@gmail.com 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
Ezio Melotti ezio.melo...@gmail.com 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
Raymond Hettinger raymond.hettin...@gmail.com 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
Jesús Cea Avión j...@jcea.es added the comment:
Patch seems good. Ezio, can you commit?.
--
nosy: +jcea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11910
___
New submission from Ezio Melotti ezio.melo...@gmail.com:
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
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
components: +Tests
nosy: +brett.cannon
stage: - patch review
type: - behavior
versions: +Python 2.7, Python 3.2, Python 3.3
___
Python tracker rep...@bugs.python.org
17 matches
Mail list logo