Skip to content

Conversation

@junkmd
Copy link
Collaborator

@junkmd junkmd commented Jan 17, 2026

Enabling Future Test Expansion:

This PR lays the groundwork for expanding the test coverage for IBindCtx, IMoniker, and IRunningObjectTable methods.
Anticipating that directly adding new tests would lead to overgrown and difficult-to-manage test modules, a proactive restructuring was undertaken.

Structured Test Module Organization:

To prevent test module bloat, the testing landscape for COM interfaces has been segmented. Tests for IBindCtx, IMoniker, and IRunningObjectTable are now separated into dedicated modules (test_bctx.py, test_moniker.py, test_rot.py).
This partitioning ensures that as new method-specific tests are introduced, they can be added to their respective, focused modules, maintaining clarity and manageability.

Eliminating Redundancy with Centralized Helpers:

The modularization of tests necessitated the extraction of common ctypes function definitions and COM-related constants.
These shared components were previously duplicated or would have become so across the newly split test files.
By centralizing them into monikers_helper.py, the project avoids "WET" code.

Moves shared constants, functions, and imports related to moniker testing
from `test_monikers.py` to a new helper module `monikers_helper.py`.
- Extract `CLSID_AntiMoniker`, `CLSID_ItemMoniker`, `MK_E_UNAVAILABLE` into `monikers_helper.py`.
- Refactor test classes in `test_bctx.py`, `test_moniker.py`, and `test_rot.py` for clarity.
- Improve test coverage and correctness for moniker-related functions.
@junkmd junkmd added this to the 1.4.15 milestone Jan 17, 2026
@junkmd junkmd added the tests enhance or fix tests label Jan 17, 2026
@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.78%. Comparing base (1f5c5d5) to head (4cc5983).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #902      +/-   ##
==========================================
+ Coverage   85.68%   85.78%   +0.10%     
==========================================
  Files         128      131       +3     
  Lines       12137    12223      +86     
==========================================
+ Hits        10400    10486      +86     
  Misses       1737     1737              

☔ 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 3ff9669 into enthought:main Jan 17, 2026
52 checks passed
@junkmd junkmd deleted the monikers_tests_enhancement branch January 17, 2026 02:36
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