-
Notifications
You must be signed in to change notification settings - Fork 53
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
AssertionError being raised instead of showing "Difference (LHS vs RHS)" #367
Comments
From a quick view it looks like You can use these assertion functions directly. Your example would then become from ward import test
from ward.expect import assert_equal
def assert_something(l, v):
assert_equal(l,v, "") # must have a msg
@test("test", tags=["test"])
def _() -> None:
assert_something(1, 2) |
Unfortunately these assert_ functions are not good enough. For one, they don't show the full traceback. Try putting the function |
Compare the result of this:
with what happens if the assert is in the main body:
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.
The text was updated successfully, but these errors were encountered: