Message135507
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. |
|
Date |
User |
Action |
Args |
2011-05-07 21:48:10 | ezio.melotti | set | recipients:
+ ezio.melotti, brett.cannon, rhettinger, jcea |
2011-05-07 21:48:10 | ezio.melotti | set | messageid: <1304804890.22.0.0270933108196.issue11910@psf.upfronthosting.co.za> |
2011-05-07 21:48:08 | ezio.melotti | link | issue11910 messages |
2011-05-07 21:48:08 | ezio.melotti | create | |
|