Skip to content

Conversation

@junkmd
Copy link
Collaborator

@junkmd junkmd commented Dec 31, 2025

This pull request introduces a critical test that ensures comtypes-generated enumeration members consistently return values dictated by their COM type information.

The tests covers the scenario of COM enums containing negative values, which was not comprehensively addressed by previous tests.
The issue with IntFlag in Python 3.15+(#894) highlighted a gap in our testing.

By verifying this fundamental behavior, we guarantee that COM interoperability remains reliable, irrespective of CPython version updates or library-specific changes.

Refactor `test_enums_in_friendly_mod` in `comtypes/test/test_client.py` to:
- Utilize a parameterized approach to test both `Scripting.StandardStreamTypes`
  and `WindowsInstaller.MsiInstallState`.
- Verify enum member presence and value consistency between the generated
  enum types and `comtypes.client.Constants`.
- Employ `subTest` for granular failure reporting in parameterized tests.
@junkmd junkmd added this to the 1.4.15 milestone Dec 31, 2025
@junkmd junkmd added the tests enhance or fix tests label Dec 31, 2025
@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.31%. Comparing base (eea9c0d) to head (5d0c7cd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #895   +/-   ##
=======================================
  Coverage   85.30%   85.31%           
=======================================
  Files         126      126           
  Lines       11936    11941    +5     
=======================================
+ Hits        10182    10187    +5     
  Misses       1754     1754           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@junkmd junkmd merged commit 9c742c8 into enthought:main Dec 31, 2025
52 checks passed
@junkmd junkmd deleted the add_test_for_neg_enum_members branch December 31, 2025 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests enhance or fix tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant