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

Fix Missing Fixture Teardown operations #260

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

HarryKrause
Copy link
Contributor

@HarryKrause HarryKrause commented Feb 22, 2024

When using the only_rerun and rerun_except queries (or both), the plug-in was removing the teardown operations from the call-stack before checking to see if the test should be re-run. This resulted in the stack having all fixture operations removed that did not correspond to a function fixture.

This commit adds a private variable to each test item that keeps track of whether a test encountered a terminal error. The plugin now checks if a test has encountered a terminal error before attempting to clear the stack.

@icemac
Copy link
Contributor

icemac commented Feb 23, 2024

Thank you for your PR. Due to other PRs the files you changed have been moved around on the master branch. Could you please rebase your changes onto the current master branch?

When using the only_rerun and rerun_except queries (or both), the
plug-in was removing the teardown operations from the call-stack before
checking to see if the test should be re-run. This resulted in the
stack having all fixture operations removed that did not correspond
to a function fixture.

This commit adds a private variable to each test item that keeps
track of whether a test encountered a terminal error. The plugin now
checks if a test has encountered a terminal error before attempting
to clear the stack.

This commit fixes:
- pytest-dev#241
- pytest-dev#234
@HarryKrause
Copy link
Contributor Author

@icemac Rebased! Let me know if you require any other updates.

@icemac icemac requested a review from hugovk February 28, 2024 07:44
Copy link
Contributor

@icemac icemac left a comment

Choose a reason for hiding this comment

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

LGTM from reading through the code.

@hugovk hugovk removed their request for review February 28, 2024 09:22
@icemac icemac merged commit 0ab54f0 into pytest-dev:master Feb 29, 2024
40 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
2 participants