gh-94808: add tests covering PySequence_{Set,Del}Slice#99123
Conversation
…cpython into cover-pysequence-slice
|
Thanks @sobolevn for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
…nGH-99123) (cherry picked from commit c5c4077) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
(cherry picked from commit c5c4077) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot wasm32-wasi 3.x has failed when building commit c5c4077. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/1046/builds/808 Failed tests:
Summary of the results of the build (if available): == Tests result: FAILURE == 327 tests OK. 10 slowest tests:
1 test failed: 108 tests skipped: Total duration: 4 min 52 sec Click to see traceback logsremote: Enumerating objects: 20, done.
remote: Counting objects: 5% (1/20)
remote: Counting objects: 10% (2/20)
remote: Counting objects: 15% (3/20)
remote: Counting objects: 20% (4/20)
remote: Counting objects: 25% (5/20)
remote: Counting objects: 30% (6/20)
remote: Counting objects: 35% (7/20)
remote: Counting objects: 40% (8/20)
remote: Counting objects: 45% (9/20)
remote: Counting objects: 50% (10/20)
remote: Counting objects: 55% (11/20)
remote: Counting objects: 60% (12/20)
remote: Counting objects: 65% (13/20)
remote: Counting objects: 70% (14/20)
remote: Counting objects: 75% (15/20)
remote: Counting objects: 80% (16/20)
remote: Counting objects: 85% (17/20)
remote: Counting objects: 90% (18/20)
remote: Counting objects: 95% (19/20)
remote: Counting objects: 100% (20/20)
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 7% (1/14)
remote: Compressing objects: 14% (2/14)
remote: Compressing objects: 21% (3/14)
remote: Compressing objects: 28% (4/14)
remote: Compressing objects: 35% (5/14)
remote: Compressing objects: 42% (6/14)
remote: Compressing objects: 50% (7/14)
remote: Compressing objects: 57% (8/14)
remote: Compressing objects: 64% (9/14)
remote: Compressing objects: 71% (10/14)
remote: Compressing objects: 78% (11/14)
remote: Compressing objects: 85% (12/14)
remote: Compressing objects: 92% (13/14)
remote: Compressing objects: 100% (14/14)
remote: Compressing objects: 100% (14/14), done.
remote: Total 14 (delta 12), reused 0 (delta 0), pack-reused 0
From https://github.com/python/cpython
* branch main -> FETCH_HEAD
Note: switching to 'c5c40773cbadc8c35212877ea315a375f3bfaa4b'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at c5c40773cb gh-94808: add tests covering `PySequence_{Set,Del}Slice` (GH-99123)
Switched to and reset branch 'main'
../../Objects/obmalloc.c:1450:1: warning: always_inline function might not be inlinable [-Wattributes]
1450 | arena_map_get(block *p, int create)
| ^~~~~~~~~~~~~
configure: WARNING: using cross tools not prefixed with host triplet
../../Python/pytime.c:297:10: warning: implicit conversion from 'long long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-const-int-float-conversion]
if (!_Py_InIntegralTypeRange(time_t, intpart)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Include/internal/pycore_pymath.h:72:45: note: expanded from macro '_Py_InIntegralTypeRange'
(_Py_IntegralTypeMin(type) <= v && v <= _Py_IntegralTypeMax(type))
~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
../../Include/internal/pycore_pymath.h:61:88: note: expanded from macro '_Py_IntegralTypeMax'
(_Py_IS_TYPE_SIGNED(type) ? (((((type)1 << (sizeof(type)*CHAR_BIT - 2)) - 1) << 1) + 1) : ~(type)0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
../../Python/pytime.c:352:14: warning: implicit conversion from 'long long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-const-int-float-conversion]
if (!_Py_InIntegralTypeRange(time_t, intpart)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Include/internal/pycore_pymath.h:72:45: note: expanded from macro '_Py_InIntegralTypeRange'
(_Py_IntegralTypeMin(type) <= v && v <= _Py_IntegralTypeMax(type))
~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
../../Include/internal/pycore_pymath.h:61:88: note: expanded from macro '_Py_IntegralTypeMax'
(_Py_IS_TYPE_SIGNED(type) ? (((((type)1 << (sizeof(type)*CHAR_BIT - 2)) - 1) << 1) + 1) : ~(type)0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
../../Python/pytime.c:518:10: warning: implicit conversion from 'long long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-const-int-float-conversion]
if (!_Py_InIntegralTypeRange(_PyTime_t, d)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Include/internal/pycore_pymath.h:72:45: note: expanded from macro '_Py_InIntegralTypeRange'
(_Py_IntegralTypeMin(type) <= v && v <= _Py_IntegralTypeMax(type))
~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
../../Include/internal/pycore_pymath.h:61:88: note: expanded from macro '_Py_IntegralTypeMax'
(_Py_IS_TYPE_SIGNED(type) ? (((((type)1 << (sizeof(type)*CHAR_BIT - 2)) - 1) << 1) + 1) : ~(type)0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
3 warnings generated.
../../Modules/expat/xmlparse.c:3116:9: warning: code will never be executed [-Wunreachable-code]
parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf,
^~~~~~
../../Modules/expat/xmlparse.c:3115:16: note: silence by adding parentheses to mark code as explicitly dead
else if (0 && parser->m_characterDataHandler)
^
/* DISABLES CODE */ ( )
../../Modules/expat/xmlparse.c:4059:9: warning: code will never be executed [-Wunreachable-code]
parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf,
^~~~~~
../../Modules/expat/xmlparse.c:4058:16: note: silence by adding parentheses to mark code as explicitly dead
else if (0 && parser->m_characterDataHandler)
^
/* DISABLES CODE */ ( )
../../Modules/expat/xmlparse.c:7703:11: warning: format specifies type 'int' but the argument has type 'ptrdiff_t' (aka 'long') [-Wformat]
bytesMore, (account == XML_ACCOUNT_DIRECT) ? "DIR" : "EXP",
^~~~~~~~~
3 warnings generated.
../../Modules/timemodule.c:151:13: warning: code will never be executed [-Wunreachable-code]
PyErr_SetString(PyExc_OverflowError,
^~~~~~~~~~~~~~~
../../Modules/timemodule.c:1958:13: warning: incompatible pointer to integer conversion passing 'const struct __clockid *' to parameter of type 'long' [-Wint-conversion]
if (PyModule_AddIntMacro(module, CLOCK_REALTIME) < 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Include/modsupport.h:59:69: note: expanded from macro 'PyModule_AddIntMacro'
#define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant((m), #c, (c))
^~~
../../Include/modsupport.h:51:71: note: passing argument to parameter here
PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long);
^
../../Modules/timemodule.c:1965:13: warning: incompatible pointer to integer conversion passing 'const struct __clockid *' to parameter of type 'long' [-Wint-conversion]
if (PyModule_AddIntMacro(module, CLOCK_MONOTONIC) < 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Include/modsupport.h:59:69: note: expanded from macro 'PyModule_AddIntMacro'
#define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant((m), #c, (c))
^~~
../../Include/modsupport.h:51:71: note: passing argument to parameter here
PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long);
^
../../Modules/timemodule.c:1982:13: warning: incompatible pointer to integer conversion passing 'const struct __clockid *' to parameter of type 'long' [-Wint-conversion]
if (PyModule_AddIntMacro(module, CLOCK_PROCESS_CPUTIME_ID) < 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Include/modsupport.h:59:69: note: expanded from macro 'PyModule_AddIntMacro'
#define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant((m), #c, (c))
^~~
../../Include/modsupport.h:51:71: note: passing argument to parameter here
PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long);
^
../../Modules/timemodule.c:1988:13: warning: incompatible pointer to integer conversion passing 'const struct __clockid *' to parameter of type 'long' [-Wint-conversion]
if (PyModule_AddIntMacro(module, CLOCK_THREAD_CPUTIME_ID) < 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Include/modsupport.h:59:69: note: expanded from macro 'PyModule_AddIntMacro'
#define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant((m), #c, (c))
^~~
../../Include/modsupport.h:51:71: note: passing argument to parameter here
PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long);
^
5 warnings generated.
cat: pybuilddir.txt: No such file or directory
make: *** [Makefile:1846: buildbottest] Error 2
Cannot open file '/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.wasi/build/build/build_oot/host/test-results.xml' for upload |
Sorry, something went wrong.
|
I've seen the buildbot failure. Going to monitor other builds: if they have the same problem, I will fix it. Thanks for the merge! |
Sorry, something went wrong.
These two method were not covered:


I haven't covered
null_error();case, because it is impossible to reach from python code.And it is also quite trivial not to bother writing its own C-level tests.