Skip to content
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

Issue #362: Only unconfigure if configured #641

Merged
merged 2 commits into from
Nov 11, 2023

Conversation

n3world
Copy link
Contributor

@n3world n3world commented Oct 23, 2023

pytest_unconfigure can be called even if pytest_configure was not. In order to avoid errors during unconfigure only perform the unconfigure if the configure was performed. Add a counter which is incremented before configure to track the number of times pytest started initialization so that the config is not popped early from the stack.

tests/test_hooks.py Show resolved Hide resolved
@youtux
Copy link
Contributor

youtux commented Oct 29, 2023

Thanks for the fix, if you can address the comments I'll happily merge this fix

`pytest_unconfigure` can be called even if `pytest_configure` was not.
In order to avoid errors during unconfigure only perform the unconfigure
if the configure was performed. Add a counter which is incremented
before configure to track the number of times pytest started
initialization so that the config is not popped early from the stack.
@n3world
Copy link
Contributor Author

n3world commented Nov 9, 2023

I also resolved the unit test failures from previous run

Copy link

codecov bot commented Nov 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5707669) 95.45% compared to head (c232828) 95.46%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #641      +/-   ##
==========================================
+ Coverage   95.45%   95.46%   +0.01%     
==========================================
  Files          49       49              
  Lines        1783     1788       +5     
  Branches      195      196       +1     
==========================================
+ Hits         1702     1707       +5     
  Misses         53       53              
  Partials       28       28              
Files Coverage Δ
src/pytest_bdd/plugin.py 98.14% <100.00%> (+0.03%) ⬆️
tests/test_hooks.py 100.00% <100.00%> (ø)

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

@youtux youtux merged commit b901519 into pytest-dev:master Nov 11, 2023
15 checks passed
@n3world n3world deleted the issue_362_unconfigure branch November 11, 2023 22:17
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