Repository navigation
Preserve context between interactive commands - #1063
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1063 +/- ##
==========================================
- Coverage 76.51% 76.28% -0.24%
==========================================
Files 62 60 -2
Lines 8308 8455 +147
==========================================
+ Hits 6357 6450 +93
- Misses 1951 2005 +54 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Repository: bpython/bpython
Issue: #918
Branch:
fix/918-decimal-contextCommit:
9c2cbc8f985a90762c46ced69f0960611162b592Description
CodeRunnerexecutes each submitted command in a fresh greenlet. Greenletsisolate
contextvars, so the decimal context changed by one command was lostwhen the next command ran. Preserve a copied context on the runner and execute
each command inside it. This keeps decimal settings (and other context-local
state) available between commands while isolating the REPL from the caller's
context.
Closes #918.
Tests
.venv/bin/pytest -q bpython/test/test_curtsies_coderunner.py bpython/test/test_interpreter.py— 11 passed, 4 subtests passed..venv/bin/pytest -q— 334 passed, 14 skipped, 3 xfailed, 16 subtests passed..venv/bin/python -m compileall -q bpython— passed.git diff --check— passed.The checkout is committed and clean. No push or pull request was created.