Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bowtie run example for smoke test #1326

Closed
wants to merge 7 commits into from
37 changes: 36 additions & 1 deletion bowtie/_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@ def __rich_console__(
),
)

schema = case.syntax(ref_dialect)
reason.add_row(
case.syntax(ref_dialect),
schema,
JSON(json.dumps(registry)),
instances,
)
Expand All @@ -215,6 +216,40 @@ def __rich_console__(
padding=2,
)
epilog.add_row(panel)

test = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's making you create a new test here? We want to show one of the ones that just failed, and tell the user how to run something which does that.

"description": "basic referencing support",
"schema": json.loads(
"".join(
segment.text for segment in console.render(schema)
adwait-godbole marked this conversation as resolved.
Show resolved Hide resolved
),
),
"registry": registry,
"tests": [
{"description": "a test", "instance": 37, "valid": False},
],
}
epilog.add_row(
Table(
Column(""),
caption=dedent(
rf"""

[blue]bowtie run -i {self.id} <(printf '
{json.dumps(test)}
')

[/]"""
"can be used to reproduce one of the "
"referencing failures."
"""
""",
),
box=None,
min_width=111,
caption_justify="left",
),
)
else:
title = f"{prefix} [/][b green]work!"

Expand Down