Skip to content

Conversation

@mgorny
Copy link
Contributor

@mgorny mgorny commented Jul 30, 2025

Fix the skips for test_trace_events_multiple_greenlets_switching* to correctly detect assertions being enabled independently of --with-pydebug. Gentoo builds Python --without-pydebug but --with-assertions, in order to benefit from assertion-implied safety checks without the full cost of PyDEBUG. For the purpose of detecting it, check for -DNDEBUG in optimization flags, as implied by disabling assertions. Leave the existing code as a fallback for when build flags are unavailable, e.g. in Windows packages.

Fix the skips for `test_trace_events_multiple_greenlets_switching*`
to correctly detect assertions being enabled independently of
`--with-pydebug`.  Gentoo builds Python `--without-pydebug` but
`--with-assertions`, in order to benefit from assertion-implied safety
checks without the full cost of PyDEBUG.  For the purpose of detecting
it, check for `-DNDEBUG` in optimization flags, as implied by disabling
assertions.  Leave the existing code as a fallback for when build flags
are unavailable, e.g. in Windows packages.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
@mgorny mgorny force-pushed the fix-assert-test-skips branch from f16e3c0 to 739cc55 Compare July 30, 2025 11:49
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Jul 31, 2025
Use an upstreamable patch to avoid crashes on py3.12+ instead of sed.
This has the clear advantage of not skipping the test on older Python
versions.

Pull-Request: python-greenlet/greenlet#457
Signed-off-by: Michał Górny <mgorny@gentoo.org>
@jamadden jamadden merged commit b288f43 into python-greenlet:master Aug 6, 2025
23 checks passed
@jamadden
Copy link
Contributor

jamadden commented Aug 6, 2025

Thanks!

@mgorny mgorny deleted the fix-assert-test-skips branch August 6, 2025 18:50
@mgorny
Copy link
Contributor Author

mgorny commented Aug 6, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants