Closed oremanj closed 4 years ago
Merging #5 into master will increase coverage by
0.40%
. The diff coverage is98.71%
.
@@ Coverage Diff @@
## master #5 +/- ##
==========================================
+ Coverage 99.42% 99.82% +0.40%
==========================================
Files 7 7
Lines 518 585 +67
Branches 37 42 +5
==========================================
+ Hits 515 584 +69
+ Misses 2 1 -1
+ Partials 1 0 -1
Flag | Coverage Δ | |
---|---|---|
#cpython | 99.14% <98.71%> (+0.49%) |
:arrow_up: |
#pypy36nightly | 89.23% <45.45%> (-4.49%) |
:arrow_down: |
#pypy36release | 89.23% <45.45%> (-4.49%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
greenback/_impl.py | 99.40% <97.95%> (+1.71%) |
:arrow_up: |
greenback/_tests/test_impl.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 00f885f...5626f9f. Read the comment docs.
greenlet 0.4.17 added support for switching contextvars when switching greenlets. Great! Except... each greenlet now starts with an empty context, and trying to work around this with
Context.run()
tends to result in problems not keeping the implicit stack ofContext.run()
calls properly nested (since if you switch away from a greenlet, anyContext.run()
it was in the middle of still appears to be active). See https://github.com/python-greenlet/greenlet/issues/196 for more details.Work around this by using ctypes to change the new greenlet's context pointer to be the same as the old one before switching. This probably comes with some performance cost, but I don't see a better alternative.