-
Notifications
You must be signed in to change notification settings - Fork 106
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
Expand conditions for recognizing main process #252
base: master
Are you sure you want to change the base?
Conversation
Fork failures are not uncommon on Cygwin, which causes an exception in the constructor. Unfortunately, cleaning up the partially-initialized instance calls the `__del__` method, which then raises another exception because `self.pid` never got set. This change should prevent the second exception.
Hi @DWesl, Am I correct that this is a bug report by way of pytest-forked, which uses |
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.
its certainly a acceptable bugfix
it should be accompanied by a test
Co-authored-by: Ronny Pfannschmidt <[email protected]>
I think testing this would require mocking This was uncovered while running |
Forgot to put the `not` back in last time.
Make sure fork fails, then check that the destructor does not raise an exception and cleans up after itself.
I forgot the keyword for a keyword-only arg, then referenced a variable that would have been assigned after an exception was raised. Add the keyword. Remove variable that will never be assigned due to exception.
I think refcounting semantics would trigger the deconstructor call while exiting the context manager in CPython, but this makes the test less dependent on CPython implementation details.
Fork failures are not uncommon on Cygwin, which causes an exception in the constructor.
Unfortunately, cleaning up the partially-initialized instance calls the
__del__
method,which then raises another exception because
self.pid
never got set.This change should prevent the second exception.
Another option is to change it to