Further warning exclusion cleanup and test improvements#10693
Merged
Conversation
Removed 11 warning exclusions that are no longer needed: - Invalid cast warnings from duck_array_ops and test_array_api - CachingFileManager deallocation warnings from backends - Deprecated treenode methods (ancestors, iter_lineage, lineage) - Test-specific deprecations that no longer exist These exclusions were verified to be safe to remove through testing. The test suite passes with 20,779 tests after removal. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Removed 3 more warning exclusions that are no longer needed: - UserWarning from test_coding_times - UserWarning from test_computation - UserWarning from test_dataset All test files pass without these warning exclusions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Removed warning exclusions that are no longer needed: - "No index created" UserWarning - Tests properly handle with pytest.warns - "pandas.MultiIndex" FutureWarning - No longer triggered - "Duplicate dimension names" UserWarning - Tests handle with local filterwarnings These warnings are either properly tested or no longer occur. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed test_dataset.py to use pytest.warns instead of warnings.catch_warnings for testing the interpolation->method deprecation warning. This makes it consistent with the other test files. Note: We cannot remove the global warning exclusion because the error:::xarray.* rule converts warnings to errors before pytest.warns can catch them. This is a known limitation of the current filterwarnings configuration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Instead of relying on a global warning exclusion, added @pytest.mark.filterwarnings decorators to the specific tests that test the interpolation->method deprecation warning. This allows the warning to be properly tested while avoiding the conflict with the error:::xarray.* rule. Now the global exclusion for this warning can be safely removed. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
for more information, see https://pre-commit.ci
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
Follow-up to #10690 with additional warning exclusion cleanup and test improvements.
Changes
1. Removed 3 more obsolete warning exclusions
"default:No index created:UserWarning:xarray.core.dataset"- Tests properly handle withpytest.warns()"default:the pandas.MultiIndex object:FutureWarning:xarray.tests.test_variable"- No longer triggered"default:Duplicate dimension names present:UserWarning:xarray.namedarray.core"- Tests handle with local@pytest.mark.filterwarnings2. Fixed quantile interpolation deprecation test handling
test_dataset.pyusepytest.warns()consistently instead ofwarnings.catch_warnings()@pytest.mark.filterwarningsdecorators to all 4 deprecation test functions to locally allow the warning3. Total impact
Test plan
🤖 Generated with Claude Code