-
-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check that each IOContext property is transferred to `stdout` and `stderr` as seen from inside a notebook
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Test | ||
import Pluto: PlutoRunner, Notebook, WorkspaceManager, Cell, ServerSession, update_run! | ||
|
||
@testset "stdout/stderr IOContext" begin | ||
🍭 = ServerSession() | ||
🍭.options.evaluation.workspace_use_distributed = true | ||
|
||
notebook = Notebook(reduce( | ||
vcat, | ||
# $(repr(p)) rather than just $p for parseable output, e.g., Symbols with colons | ||
[ | ||
Cell("($(repr(p))) in stdout"), | ||
Cell("($(repr(p))) in stderr"), | ||
] for p in pairs(PlutoRunner.default_stdout_iocontext.dict) | ||
)) | ||
|
||
update_run!(🍭, notebook, notebook.cells) | ||
for cell in values(notebook.cells_dict) | ||
@test cell.output.body == "true" | ||
end | ||
|
||
WorkspaceManager.unmake_workspace((🍭, notebook)) | ||
end |