Skip to content

Fix coverage handling for stuck scenario warning#444

Merged
dfremont merged 1 commit intoBerkeleyLearnVerify:mainfrom
lola831:fix-stuck-scenario-coverage
Mar 17, 2026
Merged

Fix coverage handling for stuck scenario warning#444
dfremont merged 1 commit intoBerkeleyLearnVerify:mainfrom
lola831:fix-stuck-scenario-coverage

Conversation

@lola831
Copy link
Collaborator

@lola831 lola831 commented Mar 17, 2026

Description

This fixes a coverage-only failure in test_scenario_stuck.

The new stuck-scenario test passes in a normal test run, but fails under the coverage workflow because src/scenic/core/dynamics/scenarios.py suppresses the warning whenever sys.gettrace() is set. Under pytest --cov, tracing is enabled, so the warning is skipped and the test fails.

behaviors.py already has logic to allow the warning under coverage while still suppressing it for a real debugger. This PR makes scenarios.py consistent with that behavior.

Issue Link

N/A

Checklist

  • I have tested the changes locally via pytest and/or other means
  • I have added or updated relevant documentation
  • I have autoformatted the code with black and isort
  • I have added test cases (if applicable)

Additional Notes

N/A

@lola831 lola831 requested a review from dfremont March 17, 2026 18:42
@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.69%. Comparing base (07625cb) to head (15342f6).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #444      +/-   ##
==========================================
+ Coverage   89.66%   89.69%   +0.03%     
==========================================
  Files          48       48              
  Lines       13193    13194       +1     
==========================================
+ Hits        11829    11834       +5     
+ Misses       1364     1360       -4     
Files with missing lines Coverage Δ
src/scenic/core/dynamics/scenarios.py 94.59% <100.00%> (+1.09%) ⬆️

... and 5 files with indirect coverage changes

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

Copy link
Collaborator

@dfremont dfremont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Lola!

@dfremont dfremont merged commit 76de20b into BerkeleyLearnVerify:main Mar 17, 2026
31 checks passed
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.

2 participants