Skip to content

Remove redundant test_isa_mapping test (fixes #10077)#10103

Merged
auvipy merged 3 commits intocelery:mainfrom
daniel7an:fix/issue-10077-redundant-issubclass
Mar 2, 2026
Merged

Remove redundant test_isa_mapping test (fixes #10077)#10103
auvipy merged 3 commits intocelery:mainfrom
daniel7an:fix/issue-10077-redundant-issubclass

Conversation

@daniel7an
Copy link
Contributor

Summary

Removes the redundant test_isa_mapping test in t/unit/utils/test_collections.py.

Problem

As noted in #10077, the test_isa_mapping test checks that ConfigurationView is a subclass of Mapping, but this is already implied by the adjacent test_isa_mutable_mapping test which checks for MutableMapping. Since MutableMapping is a subclass of Mapping, the Mapping check is always True and fully redundant.

The inheritance chain: ConfigurationView -> ChainMap -> MutableMapping -> Mapping

Changes

  • Removed test_isa_mapping from test_ConfigurationView (4 lines)
  • Kept test_isa_mutable_mapping which provides the stronger guarantee

Testing

All 51 tests in t/unit/utils/test_collections.py pass.

The test_isa_mapping test checks that ConfigurationView is a subclass
of Mapping, but this is already implied by test_isa_mutable_mapping
which checks for MutableMapping (a subclass of Mapping). Since
ConfigurationView inherits from ChainMap which is a MutableMapping,
the Mapping check is always True and fully redundant.

Fixes #10077
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes a redundant unit test in the collections utilities test suite, aligning the tests with the Python ABC inheritance hierarchy and reducing unnecessary assertions.

Changes:

  • Removed test_isa_mapping from test_ConfigurationView because MutableMapping already implies Mapping.
  • Kept test_isa_mutable_mapping as the stronger (and sufficient) inheritance assertion.

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.52%. Comparing base (1690dd3) to head (44ad800).
⚠️ Report is 29 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10103   +/-   ##
=======================================
  Coverage   87.52%   87.52%           
=======================================
  Files         153      153           
  Lines       19382    19382           
  Branches     2229     2229           
=======================================
  Hits        16965    16965           
  Misses       2121     2121           
  Partials      296      296           
Flag Coverage Δ
unittests 87.51% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@auvipy auvipy self-requested a review February 10, 2026 05:51
@auvipy auvipy added this to the 5.7.0 milestone Feb 14, 2026
@auvipy auvipy merged commit e28c952 into celery:main Mar 2, 2026
320 checks passed
Nusnus pushed a commit that referenced this pull request Mar 26, 2026
The test_isa_mapping test checks that ConfigurationView is a subclass
of Mapping, but this is already implied by test_isa_mutable_mapping
which checks for MutableMapping (a subclass of Mapping). Since
ConfigurationView inherits from ChainMap which is a MutableMapping,
the Mapping check is always True and fully redundant.

Fixes #10077

Co-authored-by: Asif Saif Uddin {"Auvi":"অভি"} <auvipy@gmail.com>
Nusnus pushed a commit that referenced this pull request Mar 26, 2026
The test_isa_mapping test checks that ConfigurationView is a subclass
of Mapping, but this is already implied by test_isa_mutable_mapping
which checks for MutableMapping (a subclass of Mapping). Since
ConfigurationView inherits from ChainMap which is a MutableMapping,
the Mapping check is always True and fully redundant.

Fixes #10077

Co-authored-by: Asif Saif Uddin {"Auvi":"অভি"} <auvipy@gmail.com>
Nusnus pushed a commit that referenced this pull request Mar 26, 2026
The test_isa_mapping test checks that ConfigurationView is a subclass
of Mapping, but this is already implied by test_isa_mutable_mapping
which checks for MutableMapping (a subclass of Mapping). Since
ConfigurationView inherits from ChainMap which is a MutableMapping,
the Mapping check is always True and fully redundant.

Fixes #10077

Co-authored-by: Asif Saif Uddin {"Auvi":"অভি"} <auvipy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants