Skip to content

[ENH] tests(lookup): isolate lookup tests to dedicated mock package#476

Open
arnavk23 wants to merge 30 commits intosktime:mainfrom
arnavk23:fix/issue-114-restrict-lookup-tests
Open

[ENH] tests(lookup): isolate lookup tests to dedicated mock package#476
arnavk23 wants to merge 30 commits intosktime:mainfrom
arnavk23:fix/issue-114-restrict-lookup-tests

Conversation

@arnavk23
Copy link
Contributor

@arnavk23 arnavk23 commented Nov 22, 2025

Reference Issues/PRs

Fixes #114.

What does this implement/fix? Explain your changes.

Isolate the lookup tests from the main package by introducing a dedicated test-only package skbase.tests.mock_package. The lookup tests now scan this small controlled package instead of skbase, preventing unrelated production refactors from breaking lookup tests.

Does your contribution introduce a new dependency? If yes, which one?

What should a reviewer concentrate their feedback on?

Any other comments?

PR checklist

For all contributions
  • I've reviewed the project documentation on contributing
  • I've added myself to the list of contributors.
  • The PR title starts with either [ENH], [CI/CD], [MNT], [DOC], or [BUG] indicating whether
    the PR topic is related to enhancement, CI/CD, maintenance, documentation, or a bug.
For code contributions
  • Unit tests have been added covering code functionality
  • Appropriate docstrings have been added (see documentation standards)
  • New public functionality has been added to the API Reference

@arnavk23 arnavk23 changed the title tests(lookup): isolate lookup tests to dedicated mock package [ENH] tests(lookup): isolate lookup tests to dedicated mock package Nov 22, 2025
__author__: List[str] = ["fkiraly", "RNKuhns"]


class Parent(BaseObject):

Check warning

Code scanning / CodeQL

`__eq__` not overridden when adding attributes Warning test

The class 'Parent' does not override
'__eq__'
, but adds the new attribute
a
.
The class 'Parent' does not override
'__eq__'
, but adds the new attribute
b
.
The class 'Parent' does not override
'__eq__'
, but adds the new attribute
c
.
@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.65%. Comparing base (306958d) to head (46e0a8b).
⚠️ Report is 177 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #476      +/-   ##
==========================================
- Coverage   85.07%   83.65%   -1.43%     
==========================================
  Files          45       52       +7     
  Lines        3015     3848     +833     
==========================================
+ Hits         2565     3219     +654     
- Misses        450      629     +179     

☔ 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.

@arnavk23 arnavk23 force-pushed the fix/issue-114-restrict-lookup-tests branch 2 times, most recently from 0c30a63 to 6e00981 Compare December 15, 2025 15:45
arnavk23 and others added 11 commits December 15, 2025 21:19
…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.
Copy link
Contributor

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@arnavk23
Copy link
Contributor Author

I would at least expect the "full package expected lookup results" to be removed.

I've removed the "full package expected lookup results" from conftest.py eliminating the SKBASE_*_BY_MODULE dictionaries that contained the expected classes and functions for the entire skbase package. I also removed the test function test_get_package_metadata_returns_expected_results that relied on those expected results, as it was checking the full package lookup against predefined expectations.

The checks for the mock package still occur through the existing tests:

  • test_all_objects_returns_expected_output verifies that all_objects returns the expected classes from MOCK_PACKAGE_OBJECTS for the mock package.
  • test_get_package_metadata_matches_expected_representation_mock_package builds expected metadata by introspecting the mock package modules and compares it against the actual results from get_package_metadata.

This ensures that expectation checks against actual retrieval still happen for the mock package, while restricting the lookup tests by removing the broader full-package validation.

arnavk23 and others added 3 commits February 14, 2026 12:56
…strict the lookup tests to only those that are relevant to the issue at hand.
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.

Reducing scope of test_get_package_metadata_returns_expected_results?

2 participants