Introduce warnings for Python 3.15 enum compatibility and improve test stability. #907
+56
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request is focusing on the introduction of warnings regarding Python 3.15 compatibility, enhancement of existing test stability, and prevention of potential errors in memory-related tests.
Warnings for Python 3.15
enumBehavior ChangesTo address the upcoming changes in
IntFlaghandling in Python 3.15, introducing aFutureWarningto proactively notify users of potential behavioral shifts.An initial explanation of this change has also been added to
README.md.Test Assertions in
test_puredispatch.pyIn
test_puredispatch.py, test assertions for theProductStateproperty now directly use module-level constants.This is a measure to avoid being affected by the reinterpretation of
IntFlagin Python 3.15.Skipping Tests in Python 3.15 Alpha/Beta
To prevent CI failures caused by known but unfinalized changes in Python 3.15's alpha and beta versions, specific tests related to
enumbehavior are now conditionally skipped.This allows the CI pipeline to remain green, preventing new, unrelated bugs from being obscured.
This skipping mechanism is intended as a temporary measure until Python 3.15 reaches a Release Candidate (RC) stage, at which point these tests will be unskipped to ensure full compatibility validation for the final release.
Ensuring Memory Safety in
from_outparamTestsThe
test_outparammodule has been updated to prevent potential memory-related inconsistency.By using
create_unicode_buffer, the tests can safely verify the behavior offrom_outparamon memory outside of the COM allocator's control.