TST Fix test_nested_parallel_warnings_parent_backend for Python nogil#1394
Merged
tomMoral merged 2 commits intojoblib:masterfrom Feb 20, 2023
Merged
TST Fix test_nested_parallel_warnings_parent_backend for Python nogil#1394tomMoral merged 2 commits intojoblib:masterfrom
tomMoral merged 2 commits intojoblib:masterfrom
Conversation
Codecov ReportBase: 93.32% // Head: 94.04% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1394 +/- ##
==========================================
+ Coverage 93.32% 94.04% +0.71%
==========================================
Files 52 52
Lines 7300 7343 +43
==========================================
+ Hits 6813 6906 +93
+ Misses 487 437 -50
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
jjerphan
approved these changes
Feb 17, 2023
joblib/test/test_parallel.py
Outdated
Comment on lines
+210
to
+214
| # when the outer backend is threading and with nogil, we might see | ||
| # more that one warning | ||
| warnings_have_the_right_length = ( | ||
| len(warninfo) >= 1 if getattr(sys.flags, 'nogil', False) | ||
| else len(warninfo) == 1) |
Contributor
There was a problem hiding this comment.
When reading this comment, nogil can be thought as a nogil-Cython context, and not as the eponymous fork of CPython.
Does this makes this adaptation slightly clearer?
Suggested change
| # when the outer backend is threading and with nogil, we might see | |
| # more that one warning | |
| warnings_have_the_right_length = ( | |
| len(warninfo) >= 1 if getattr(sys.flags, 'nogil', False) | |
| else len(warninfo) == 1) | |
| # When the outer backend is threading and when one uses nogil | |
| # (the fork of CPython), we might observe more that one warning. | |
| python_interpreter_is_nogil = getattr(sys.flags, 'nogil', False) | |
| n_warnings = len(warninfo) | |
| warnings_have_the_right_length = ( | |
| n_warnings >= 1 if python_interpreter_is_nogil | |
| else n_warnings == 1 | |
| ) |
Member
Author
There was a problem hiding this comment.
I tweak the wording to use "Python nogil" I guess this is good enough
tomMoral
approved these changes
Feb 20, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Another fix for making the test pass with Python nogil