-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meta issue: Mark all CPython-specific tests with a test.support.cpython_only
decorator
#115142
Comments
test.support.cpython_only
decoratortest.support.cpython_only
decorator
How are you going to determine that they are CPython-specific? |
It is a good question. |
This is a complicated issue that to me needs some meta-level discussion and possible inclusion of representatives of other implementations. I have several questions.
Why? The answer depends on how broadly or narrowly 'CPython-specific' is defined.
'Us' as Python developers, or as CPython developers? I am responding mostly as a Python developer whose C knowledge has faded somewhat.
Perhaps implementation skips of asserts should be discouraged. There may be some OS-dependent assert in IDLE test, but that is another matter.
If implementations that copy the module code also copy the test code, what is the problem? Or perhaps, should there be a problem? Do we have it as a goal that (with rare documented exceptions) Python-coded stdlib modules only depend on Python, and not CPython-specific behaviors? Should they avoid, for instance, depending on CPython's specific int caching? One way to test and catch this, would be to have an alternate test build that behaved otherwise, such as by disabling the caching. |
See also #69317. PyPy uses modified CPython tests. We can look at that modifications and decide which of them are CPython-specific and which are PyPy-specific. |
Sorry, I was unclear here. It's not make any benefit for CPython developers, but there are obvious benefits for Python ecosystem - testing other Python implementations will be easier.
That's depends on test which we'd like to transform. Tests like
It's a good question! I think we talking about CPython-specific tests. For example, there are tests for |
One more detail: I think these kind of changes should be backportable where it is possible. |
…api`` is not available (python#116507)
…i`` and ``_testlimitedcapi`` are not available (pythonGH-117588) (cherry picked from commit dfcae43) Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> pythongh-115142: Skip test_dict if _testcapi and _testlimitedcapi is not available
…api`` is not available (python#116507)
… ``_testlimitedcapi`` are not available (pythonGH-117588) pythongh-115142: Skip test_dict if _testcapi and _testlimitedcapi is not available
…i`` is not available (pythonGH-117574)
…stinternalcapi`` is not available (#124474) * Skip some test cases if "_testinternalcapi" is not available and if the test suite is running on another implementation than CPython.
Bug report
Bug description:
There's a certain amount of Cpython-specific tests which isn't marked with a
cpython_only
decorator.I'm certain that CPython-specific tests should be excluded from running on any other implementation, which is advantageous for us. This ensures that when developing another Python implementation, you can selectively avoid running these specific CPython tests, which is beneficial during the testing phase. This way, you can focus on relevant tests for your implementation without unnecessary interference from CPython-specific ones.
So, my final goal is to make the whole CPython test suite runnable on other Python implementations.
I would like to send a one PR per test file which needs a fix.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
test_optimizer
if_testinternalcapi
module is not available. #115175test__xxsubinterpreters
if_testinternalcapi
is not available #116507test__xxsubinterpreters
if_testcapi
is not available #116543test_capi/test_opt.py
if_testinternalcapi
is not available #117574test_capi.test_dict.py
if_testcapi
and_testlimitedcapi
are not available #117588test_capi.test_dict.py
if_testcapi
an… #117718Lib/test/test_compile
if_testinternalcapi
is not available #124474The text was updated successfully, but these errors were encountered: