Repository navigation
«Tests» starts as ▶ Ausführen: empty console, fresh session, then the report - #36
Merged
Merged
Conversation
Tests used to load the file into a namespace of its own and append its report, so after an edit and Tests the REPL still held the definitions of the last Run. Now Tests first does what Run does - an empty console, the current files run as __main__ into a fresh REPL session (output streams, the REPL's replay record starts anew) - and then runs the doctests and shows their report. The REPL then has exactly the definitions just tested. If the file itself fails, its traceback and hint are the answer and no report repeats the load error. The report no longer shows what the file printed while loading; the Run part already did. The worker's run is one function now (runProgram), used by run and test. #34's reveal of REPL answers, reports and the stop note stays. test:console: the second Tests run leaves only its own report, and a new scenario checks Tests → REPL → edit → Tests → REPL uses the new definition. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
For v0.1.15: «Tests» behaves like ▶ Ausführen, in the embed and the IDE alike.
Before
Tests loaded the file into a namespace of its own and appended its report. The REPL kept the definitions of the last Run. After editing and pressing Tests,
f()in the REPL still used the oldf(or raisedNameErrorif there had been no Run) until ▶ Ausführen.Now
__main__in a fresh REPL session, their output streams into the console, and the REPL's replay record (2c) starts anew. All of this is the same code as Run: the worker'srunProgram, now used byrunandtest.test-resultwithskipped).Tests
npm run test:console(in CI):f()→1; edit → Tests (no Run) → REPLf()→2.main's build all three fail: two reports instead of one, and the REPL answersNameError: name 'f' is not definedafter Tests without a Run.Also checked by hand:
1 / 0at the end gives its output, the traceback and the hint, no report, and Tests works again after the fix. «Beispiel visualisieren» shows «Erhalten: 4 · Erwartet: 5».f()→1. After an edit and Tests, the console holds only «(Keine Ausgabe)» and «1 von 1 Beispielen bestanden», andf()→2.Note: a file that asks for
input()while loading now asks twice per Tests run (Run part, then the doctest load). The course doesn't useinput().Lint (known warning only), both builds,
test:protocol,test:hints,test:runtimeandtest:consolepass. After the merge I tag v0.1.15 and bump the IDE.🤖 Generated with Claude Code