This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients brett.cannon, ezio.melotti, jcea, rhettinger
Date 2011-05-07.21:48:08
SpamBayes Score 1.0684731e-10
Marked as misclassified No
Message-id <1304804890.22.0.0270933108196.issue11910@psf.upfronthosting.co.za>
In-reply-to
Content
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 and the C tests could inherit directly from the Python ones (possibly adding additional C-specific tests).  I actually prefer this way because the Python tests should be an invariant of all the Python implementations and additional tests for the accelerations can be created from them with appropriate skip decorators, e.g.:
class PythonFooTests(TestCase):
    ...

@skipUnless(is_cypthon and c_foo)
class CFooTests(PythonTest):
   ...

@skipUnless(is_jython and j_foo)
class JFooTests(PythonTest):
   ...

This also avoid to list the tests explicitly at the end to exclude the base class (e.g. currently we have to exclude TestHeap, and list TestHeapC and TestHeapPy).


We could come up with some smart class decorator that runs a set of tests with and without accelerations, but it will make more difficult to add tests specific to the C or Python versions.
History
Date User Action Args
2011-05-07 21:48:10ezio.melottisetrecipients: + ezio.melotti, brett.cannon, rhettinger, jcea
2011-05-07 21:48:10ezio.melottisetmessageid: <1304804890.22.0.0270933108196.issue11910@psf.upfronthosting.co.za>
2011-05-07 21:48:08ezio.melottilinkissue11910 messages
2011-05-07 21:48:08ezio.melotticreate