Skip to content

👌 Reset directive option specs at start of build #1448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 15, 2025
Merged

Conversation

ubmarco
Copy link
Member

@ubmarco ubmarco commented Apr 26, 2025

This fixes the problem, that the option_spec attributes are modified on a class level for:

  • NeedDirective
  • NeedextendDirective
  • NeedserviceDirective

and thus remain changed for subsequent sphinx runs in the same interpreter session.

The problem was a finding of #1441.

This is particularly of issue for SN test cases, which all run in the same Python interpreter,
and should ideally be reproducible, independent of any preceding tests run.

The PR defines a reset_options_spec class method for modified directives,
to revert the runtime changes during the config-inited event.

@ubmarco ubmarco changed the title 🧪 Reset SN for testing 👌 Reset SN for testing Apr 26, 2025
Copy link

codecov bot commented Apr 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.70%. Comparing base (4e10030) to head (a8c1a38).
Report is 130 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1448      +/-   ##
==========================================
+ Coverage   86.87%   88.70%   +1.82%     
==========================================
  Files          56       62       +6     
  Lines        6532     7332     +800     
==========================================
+ Hits         5675     6504     +829     
+ Misses        857      828      -29     
Flag Coverage Δ
pytests 88.70% <100.00%> (+1.82%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ubmarco ubmarco requested a review from chrisjsewell April 26, 2025 10:44
@ubmarco ubmarco marked this pull request as ready for review April 26, 2025 10:44
@ubmarco ubmarco force-pushed the mh-reset-sn branch 2 times, most recently from e76c954 to eeada5b Compare April 29, 2025 11:53
@ubmarco ubmarco self-assigned this May 1, 2025
@chrisjsewell chrisjsewell changed the title 👌 Reset SN for testing 👌 Reset directive option specs at start of build May 15, 2025
Copy link
Member

@chrisjsewell chrisjsewell left a comment

Choose a reason for hiding this comment

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

cheers!

@chrisjsewell chrisjsewell merged commit 6ec1f9c into master May 15, 2025
17 checks passed
@chrisjsewell chrisjsewell deleted the mh-reset-sn branch May 15, 2025 14:05
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