| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…ositionals Move the "deprecated positinal" tests from clinic.test.c to _testclinic.c. Mock PY_VERSION_HEX in order to prevent the generated compiler warnings/errors to trigger. Put clinic code for deprecated positionals in Modules/clinic/_testclinic_depr_star.c.h for easy inspection of the generated code.
|
The big diff is caused by moving the generated clinic code. |
Sorry, something went wrong.
|
@serhiy-storchaka, IMO this is better than visual inspection of the generated code. We want to prevent regressions because of future refactorings, features and bugfixes. |
Sorry, something went wrong.
|
The CI currently isn't running on this PR due to merge conflicts -- I tried building with it locally, but it causes build failures on Windows: Build FAILED.
C:\Users\alexw\coding\cpython\Modules\clinic\_testclinic_depr_star.c.h(11,1): error C2133: 'deprecate_positional_pos0_len1__doc__': unknown size [C:\Users\
alexw\coding\cpython\PCbuild\_testclinic.vcxproj]
C:\Users\alexw\coding\cpython\Modules\clinic\_testclinic_depr_star.c.h(98,1): error C2133: 'deprecate_positional_pos0_len2__doc__': unknown size [C:\Users\
alexw\coding\cpython\PCbuild\_testclinic.vcxproj]
C:\Users\alexw\coding\cpython\Modules\clinic\_testclinic_depr_star.c.h(188,1): error C2133: 'deprecate_positional_pos0_len3_with_kwd__doc__': unknown size
[C:\Users\alexw\coding\cpython\PCbuild\_testclinic.vcxproj]
C:\Users\alexw\coding\cpython\Modules\clinic\_testclinic_depr_star.c.h(287,1): error C2133: 'deprecate_positional_pos1_len1_optional__doc__': unknown size
[C:\Users\alexw\coding\cpython\PCbuild\_testclinic.vcxproj]
C:\Users\alexw\coding\cpython\Modules\clinic\_testclinic_depr_star.c.h(383,1): error C2133: 'deprecate_positional_pos1_len1__doc__': unknown size [C:\Users
\alexw\coding\cpython\PCbuild\_testclinic.vcxproj]
C:\Users\alexw\coding\cpython\Modules\clinic\_testclinic_depr_star.c.h(473,1): error C2133: 'deprecate_positional_pos1_len2_with_kwd__doc__': unknown size
[C:\Users\alexw\coding\cpython\PCbuild\_testclinic.vcxproj]
C:\Users\alexw\coding\cpython\Modules\clinic\_testclinic_depr_star.c.h(572,1): error C2133: 'deprecate_positional_pos2_len1__doc__': unknown size [C:\Users
\alexw\coding\cpython\PCbuild\_testclinic.vcxproj]
C:\Users\alexw\coding\cpython\Modules\clinic\_testclinic_depr_star.c.h(664,1): error C2133: 'deprecate_positional_pos2_len2__doc__': unknown size [C:\Users
\alexw\coding\cpython\PCbuild\_testclinic.vcxproj]
C:\Users\alexw\coding\cpython\Modules\clinic\_testclinic_depr_star.c.h(758,1): error C2133: 'deprecate_positional_pos2_len3_with_kwd__doc__': unknown size
[C:\Users\alexw\coding\cpython\PCbuild\_testclinic.vcxproj]
0 Warning(s)
9 Error(s)
|
Sorry, something went wrong.
Does it still happen? |
Sorry, something went wrong.
| output push | ||
| destination deprstar new file '{dirname}/clinic/_testclinic_depr_star.c.h' | ||
| output everything deprstar | ||
| #output methoddef_ifndef buffer 1 |
There was a problem hiding this comment.
The output directive has a bug that prevents us from specifying the stack index. We should fix that in a separate PR.
Sorry, something went wrong.
Nope! Builds fine locally now :) |
Sorry, something went wrong.
There was a problem hiding this comment.
Would not be better to use version like 100.200 to avoid rewriting tests every year?
Sorry, something went wrong.
No need, we mock the version. |
Sorry, something went wrong.
There was a problem hiding this comment.
Do the test fail if change the stacklevel argument in PyErr_WarnEx() from 1 to 2?
Sorry, something went wrong.
They do not. The same filename is produced for both stack levels. |
Sorry, something went wrong.
|
And wrong stacklevel is a common error. Even your original code did have it wrong initially. Therefore, I think it is important to check it using one of the methods I suggested above. |
Sorry, something went wrong.
|
Note: we will get merge conflicts from #107808. |
Sorry, something went wrong.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
There was a problem hiding this comment.
I agree with Serhiy that explicitly testing the stacklevel would be good. Other than that, this is looking much better now, thanks! The readabiliy is much improved :)
Sorry, something went wrong.
There was a problem hiding this comment.
I'm happy if Serhiy's happy!
Sorry, something went wrong.
There was a problem hiding this comment.
Few nitpicks and LGTM.
Sorry, something went wrong.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
Thank you Serhiy and Alex; this PR is in much better shape now! With this, we've got a nice framework for similar tests in place. I'll start working on what's left in clinic.test.c. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Move the "deprecated positinal" tests from clinic.test.c to
_testclinic.c. Mock PY_VERSION_HEX in order to prevent the generated
compiler warnings/errors to trigger. Put clinic code for deprecated
positionals in Modules/clinic/_testclinic_depr_star.c.h for easy
inspection of the generated code.