🧪 test: add stdlib module detection tests#7
Conversation
Add `TestStdlibModuleDetection` to verify `ASTParser._is_stdlib_module` handles edge cases like `""` and `None` correctly. Also add tests for common stdlib modules, submodules, non-stdlib modules, and internal modules to improve code coverage. Add `# ruff: noqa: UP040` to `sample_type_aliases.py` to prevent ruff from updating the pre-3.12 alias syntax and breaking other tests. Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
Adds unit test coverage for ASTParser._is_stdlib_module edge cases and updates the type-alias fixture to preserve “pre-3.12” alias style under Ruff.
Changes:
- Add a new
TestStdlibModuleDetectiontest class covering empty/None, stdlib modules/submodules, non-stdlib modules, and internal underscore-prefixed modules. - Update
tests/fixtures/sample_type_aliases.pyto useTypeAliasassignments for pre-3.12-style aliases and add a Ruff suppression forUP040.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/test_ast_parser.py | Adds direct unit tests for stdlib module detection helper. |
| tests/fixtures/sample_type_aliases.py | Restores mixed alias styles (TypeAlias + type) and suppresses Ruff’s UP040 rewrite. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com>
Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com>
🎯 What: The testing gap addressed
The
_is_stdlib_modulemethod inASTParserwas missing tests, specifically for edge cases like passing""orNone.📊 Coverage: What scenarios are now tested
sys,os,pathlib)os.path)requests,numpy,exportify)_ast,_io)✨ Result: The improvement in test coverage
The
_is_stdlib_modulemethod is now fully covered by unit tests, ensuring future refactoring won't break its behavior for valid or invalid inputs. I also added aruff: noqadirective tosample_type_aliases.pyto prevent formatting from breaking existing alias detection tests.PR created automatically by Jules for task 12721888822113959734 started by @bashandbone