-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Added an environment variable which helps to check if a code is running from within a pytest run, Fixes #9502 #12190
Conversation
…ion, this is set when pytest is running and unset just before pytest is stopped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dheerajck!
Please see my suggestions.
Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
also can I ask why was a ut failing before the latest commit but not right now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my suggestion to preserve the original PYTEST_VERSION, so pytester.runpytest()
is more robust.
…t run by the calling process, we set it back after pytest run Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
for more information, see https://pre-commit.ci
Do we need any more changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much. This is a clean approach and may have other use cases.
No description provided.