TST Fix test_nested_parallel_warnings_parent_backend for Python nogil - #1394
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. |
| # 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) |
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?
| # 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 | |
| ) |
There was a problem hiding this comment.
I tweak the wording to use "Python nogil" I guess this is good enough
Another fix for making the test pass with Python nogil