Fix computed fields, parser conditionals, and ship pytest plugin#22
Merged
Fix computed fields, parser conditionals, and ship pytest plugin#22
Conversation
When root_key is set, the filter that strips computed fields before a retry pass now operates on the inner dict instead of the top-level wrapper. Also introduces make_questions/make_form schema-based test fixtures and migrates all renderer tests to use JSONSchema dicts. Closes #17
jsonschema_to_form now delegates to _build_subquestions for the root schema, so conditional questions defined via top-level allOf/if/then blocks are parsed into the form. Also migrates condition tests in test_stdlib.py from direct Form construction to schema dicts. Closes #20
_build_subquestions now inserts allOf/if/then conditional questions immediately after the question they depend on, instead of appending them after all properties. This produces intuitive question ordering and fixes back-navigation between gating and conditional questions. Closes #21
Add tui_forms.fixtures package with a pytest plugin registered via the pytest11 entry point. Provides make_questions, make_form, render_form, and render_form_capture_input fixtures that adapt patching strategy based on the renderer class. Typed with runtime-checkable Protocols. Install with tui-forms[test]. Closes #19
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.
Summary
root_keyis set. The filter now operates on the inner dict instead of the top-level wrapper.tui-formsas a pytest plugin (pytest11entry point) withmake_questions,make_form,render_form, andrender_form_capture_inputfixtures. Typed with@runtime_checkableProtocols. Install withtui-forms[test].allOf/if/thenconditional questions injsonschema_to_form.form.Question(...)construction to JSONSchema dicts via the newmake_formfixture.Test plan
make testpasses (412 tests)make format && make lint && make lint-mypycleanmake docs-htmlbuilds without errorsmake docs-valereports 0 errors on new pagesmake docs-linkcheckbrokenreports no broken linksCloses #17
Closes #19
Closes #20
Closes #21