Skip to content

back-end for test case generator#547

Open
FitashUlHaq wants to merge 2 commits into
masterfrom
feature-test-gen
Open

back-end for test case generator#547
FitashUlHaq wants to merge 2 commits into
masterfrom
feature-test-gen

Conversation

@FitashUlHaq

Copy link
Copy Markdown
Collaborator

This commit contains the back-end for test case generator

@FitashUlHaq FitashUlHaq requested a review from ArmenSl June 1, 2026 10:21
Easy-finding cleanups from the deep review of PR #547. Design-call
items (hypothesis dep gating, class rename to avoid pytest collision,
template logic bugs around assoc.multiplicity/target_class, OCL/quote
injection hardening, missing tests, missing docs) are left for
@FitashUlHaq to address.

* Delete hypothesis_tests_template.py_old.j2 (452-line dead template).
* test_generator.py:
  - Add module docstring.
  - Move duplicated 'import re' and 'from jinja2 import ...' from
    inside generate() to module top.
  - Promote regex_findall / regex_replace to module-level helpers
    (they are referenced by the OCL section of the template, line 235+,
    so keep them registered as Jinja filters; pre-existing nested
    defs only worked by accident).
  - Drop the unused *args from generate(); add -> None return type.
  - Remove the print() debug left in.
  - Normalize quote style and dict alignment per ruff/black defaults.
* __init__.py: explicit 'X as X' re-export to silence ruff F401.
* backend/config/generators.py:
  - Dedent the 'test_case' GeneratorInfo kwargs from 8 spaces to 4
    to match every sibling entry.
  - Move the 'test_case' branch of get_filename_for_generator into
    the python/pydantic/... dispatch chain rather than hanging off
    the 'if not info:' early-return guard.

Verified: ruff check passes; generator produces a non-empty
test_hypothesis.py for a minimal DomainModel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants