Skip to content

Improve testing of phlex Python annotations#328

Merged
knoepfel merged 1 commit intomainfrom
jules-maintenance-improve-python-annotation-coverage-8666460460076968556
Feb 16, 2026
Merged

Improve testing of phlex Python annotations#328
knoepfel merged 1 commit intomainfrom
jules-maintenance-improve-python-annotation-coverage-8666460460076968556

Conversation

@greenc-FNAL
Copy link
Copy Markdown
Contributor

This PR improves the testing of plugins/python/python/phlex/__init__.py by adding unit tests for the MissingAnnotation exception. It covers the case where a required argument is missing from the annotations and verifies that optional arguments with default values do not trigger the exception. These changes bring the coverage of phlex/__init__.py to 100%.


PR created automatically by Jules for task 8666460460076968556 started by @greenc-FNAL

- Added test_missing_annotation_raises to verify MissingAnnotation is raised for required arguments.
- Added test_missing_optional_annotation_does_not_raise to verify optional arguments are handled correctly.
- Achieved 100% coverage for plugins/python/python/phlex/__init__.py.
- Verified formatting with ruff.

Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings February 16, 2026 16:06
Copy link
Copy Markdown
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

Adds unit test coverage for phlex.MissingAnnotation behavior as exercised through phlex.Variant, ensuring required-but-unannotated parameters raise and optional parameters with defaults do not.

Changes:

  • Import MissingAnnotation into the Variant unit test module.
  • Add tests verifying Variant(...) raises MissingAnnotation when a required parameter annotation is missing.
  • Add tests verifying missing annotations for defaulted (optional) parameters do not raise.

@greenc-FNAL greenc-FNAL requested a review from knoepfel February 16, 2026 16:10
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main     #328      +/-   ##
==========================================
+ Coverage   80.20%   80.39%   +0.19%     
==========================================
  Files         127      127              
  Lines        3102     3102              
  Branches      547      547              
==========================================
+ Hits         2488     2494       +6     
+ Misses        386      381       -5     
+ Partials      228      227       -1     
Flag Coverage Δ
unittests 80.39% <ø> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c2b7fd8...af73362. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@knoepfel knoepfel merged commit a3f03ed into main Feb 16, 2026
53 checks passed
@knoepfel knoepfel deleted the jules-maintenance-improve-python-annotation-coverage-8666460460076968556 branch February 16, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants