[ENH] isolate lookup tests to dedicated mock package#476
[ENH] isolate lookup tests to dedicated mock package#476arnavk23 wants to merge 40 commits intosktime:mainfrom
Conversation
…isolate tests to skbase.tests.mock_package (fix sktime#114)
…e to improve mock coverage (edge cases)
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
| __author__: List[str] = ["fkiraly", "RNKuhns"] | ||
|
|
||
|
|
||
| class Parent(BaseObject): |
Check warning
Code scanning / CodeQL
`__eq__` not overridden when adding attributes Warning test
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #476 +/- ##
==========================================
- Coverage 85.07% 84.46% -0.61%
==========================================
Files 45 52 +7
Lines 3015 3933 +918
==========================================
+ Hits 2565 3322 +757
- Misses 450 611 +161 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0c30a63 to
6e00981
Compare
…n mock_package modules Classes defined in test_fixtures.py should only appear in that module's metadata, not in __init__.py or test_mock_package.py where they're imported. Removed Parent, Child, ClassWithABTrue from __all__ lists to match the test's expectation that get_package_metadata only reports classes actually defined in each module (cls.__module__ == module.__name__).
…ckage Classes are imported for re-export to maintain the module's public API but are intentionally not listed in __all__ to ensure get_package_metadata only reports classes defined in each module.
for more information, see https://pre-commit.ci
fkiraly
left a comment
There was a problem hiding this comment.
Great!
There is though an entire config file which checks expectations against actuals after retrieval.
I would expect that still to happen for the mock package, but it does not - are you sure you have moved all tests over? I would at least expect the "full package expected lookup results" to be removed.
…strict the lookup tests to only those that are relevant to the issue at hand.
for more information, see https://pre-commit.ci
fkiraly
left a comment
There was a problem hiding this comment.
It feels like you are using AI to make changes.
You have made some changes related to my review request, but _conftest looks like a combination of changes that are sensible, some that are random and introduce issues.
Can you comment - after thinking about what you are doing? How did you address the changes and why?
|
Also, the mock package does not have private modules or functions - this reduces test coverage. Coverage should not be reduced. |
…them. Also added a test for the lookup function to check that it does not return private members.
for more information, see https://pre-commit.ci
…hub.com/arnavk23/skbase into fix/issue-114-restrict-lookup-tests
|
@fkiraly Thank you for pointing that out. I have made some changes. Please review and do share if there is anything you need. |
Reference Issues/PRs
Fixes #114.
What does this implement/fix? Explain your changes.
This PR isolates
lookuptests from the main package by introducing a dedicated test-only package,skbase.tests.mock_package.The lookup tests scan this small controlled package instead of scanning
skbasedirectly. This decouples lookup tests from unrelated production-package refactors and prevents brittle failures when internals outside lookup change.Does your contribution introduce a new dependency? If yes, which one?
No.
What should a reviewer concentrate their feedback on?
mock_packageexpectations accurately model intendedlookupbehavior.Any other comments?
The intent is to make lookup tests deterministic and focused on lookup behavior, not on unrelated evolution of the production package structure.
PR checklist
For all contributions
the PR topic is related to enhancement, CI/CD, maintenance, documentation, or a bug.
For code contributions