Repository navigation
📈 Increase Code Coverage to 99% - #451
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #451 +/- ##
==========================================
+ Coverage 97.11% 98.79% +1.68%
==========================================
Files 9 9
Lines 832 832
==========================================
+ Hits 808 822 +14
+ Misses 24 10 -14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
📈 Increase Code Coverage to 99%
Summary
This PR significantly improves code coverage across the Wikipedia-API codebase, bringing overall coverage from 97% to 99% and achieving 100% coverage for multiple core modules.
🎯 Coverage Improvements
✅ Before vs After
🧪 What Was Added
1. New Test File:
tests/wikipedia_page_section_test.pyKey Test Coverage:
section_by_title()- subsection lookup and edge casesfull_text()- multiple formats and content scenariosNotImplementedErrorfor unknown formats2. Enhanced
tests/wikipedia_test.pyextracts()- empty return for missing pagesinfo()- page return for missing pageslanglinks()- empty dict for missing pageslinks()- empty dict for missing pagesbacklinks()- empty dict for missing pagescategories()- empty dict for missing pagescategorymembers()- empty dict for missing pages3. Enhanced
tests/wikipedia_page_test.pysections_by_title()when section doesn't exist📊 Final Coverage Report
✅ Quality Assurance
Code Quality: ✅ Perfect
Testing: ✅ Comprehensive
🔍 Remaining Uncovered Lines
Only 10 infrastructure lines remain uncovered:
These are acceptable infrastructure lines that don't affect core functionality.
🚀 Benefits
📋 Requirements Compliance
✅ Code Coverage: All modules ≥90% (achieved 98-100%)
✅ Code Quality: All pre-commit hooks pass
✅ Test Coverage: Overall 99% (exceeds 90% requirement)
🎉 Impact
This PR brings the Wikipedia-API project to near-perfect test coverage while maintaining excellent code quality standards. The comprehensive test suite now protects virtually all functionality, making the codebase more robust and maintainable.