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

Add option to skip additional levels in pseudotraceback #130

Closed
mbergen opened this issue Jun 7, 2023 · 4 comments
Closed

Add option to skip additional levels in pseudotraceback #130

mbergen opened this issue Jun 7, 2023 · 4 comments

Comments

@mbergen
Copy link

mbergen commented Jun 7, 2023

It would be great to have an option for the various check functions to skip additional traceback levels.
This would benefit situations where the actual check is encapsulated into a helper function (e.g. to check multiple things at a time, and not directly done in the test method.

Example:
checkResponse could be omitted in the pseudotraceback

def test_1():
  response = apiCall()
  checkResponse(response, expected)

def checkResponse(response, expected):
  check.equal(response.status, 200)
  check.equal(response.content, expected)
@okken
Copy link
Owner

okken commented Jul 4, 2023

Interesting idea.
I'd probably like it to utilize __tracebackhide__.

Is this something you'd like to implement?

@okken
Copy link
Owner

okken commented Jul 5, 2023

fix in progress

@okken
Copy link
Owner

okken commented Jul 14, 2023

version 2.2.0 honors tracebackhide

@okken okken closed this as completed Jul 14, 2023
@mbergen
Copy link
Author

mbergen commented Jul 16, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants