-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Description
I don't know whether it's already possible to do it but I would like to have the possibility to make the CI/CD pass (or maybe fail to avoid surprises, but with a specific job) even if I do not have yet the C implementation. The idea is to have the following possibility:
class MixinTest:
def test(self):
# some code that is tested with something written in C or in Python
...
@test.support.has_implementation('c')
def test_c_only(self):
# some code that is tested only if something is written in C
...
@test.support.has_implementation('py')
def test_python_only(self):
# some code that is tested only if something is written in Python
...
In #120728, I currently have the tests skipped because whenever I push a commit, the CI/CD would try to run tests for both the Python implementation and the C implementation (e.g., for BytesIO
, or datetime
). This might be quite annoying when we only want to add the Python implementation and check whether the tests are correct or not (if they already fail here, it doesn't make sense to implement the C implementation).
Actually, this issue essentially arises from the fact that mixin classes are used to avoid test duplications, but those mixin classes do not give the possibility to check whether the interface being tested is the C or the Python implementation (for instance, we could have data = self.myclass(...)
where myclass
is _pyio.BytesIO
(in Python) or io.BytesIO
(in C)).