-
-
Notifications
You must be signed in to change notification settings - Fork 293
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
- Loading branch information
Showing
2 changed files
with
25 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 |
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