Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

AssertionError being raised instead of showing "Difference (LHS vs RHS)" #367

Description

@nonamethanks
from ward import test

def assert_something(l, v):
    assert l == v

@test("test", tags=["test"])
def _() -> None:
    assert_something(1, 2)

Compare the result of this:
image
with what happens if the assert is in the main body:
image

How do I make it print the proper output normally? For large tests it becomes a mess to figure out what's wrong unless I assign a million variables in each function in order to inspect the locals. I checked the documentation and found no mention of reusing assertions like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions