Remove redundant test_isa_mapping test (fixes #10077)#10103
Merged
auvipy merged 3 commits intocelery:mainfrom Mar 2, 2026
Merged
Remove redundant test_isa_mapping test (fixes #10077)#10103auvipy merged 3 commits intocelery:mainfrom
auvipy merged 3 commits intocelery:mainfrom
Conversation
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
Contributor
There was a problem hiding this comment.
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_mappingfromtest_ConfigurationViewbecauseMutableMappingalready impliesMapping. - Kept
test_isa_mutable_mappingas the stronger (and sufficient) inheritance assertion.
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
auvipy
approved these changes
Mar 2, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the redundant
test_isa_mappingtest int/unit/utils/test_collections.py.Problem
As noted in #10077, the
test_isa_mappingtest checks thatConfigurationViewis a subclass ofMapping, but this is already implied by the adjacenttest_isa_mutable_mappingtest which checks forMutableMapping. SinceMutableMappingis a subclass ofMapping, theMappingcheck is alwaysTrueand fully redundant.The inheritance chain:
ConfigurationView -> ChainMap -> MutableMapping -> MappingChanges
test_isa_mappingfromtest_ConfigurationView(4 lines)test_isa_mutable_mappingwhich provides the stronger guaranteeTesting
All 51 tests in
t/unit/utils/test_collections.pypass.