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

Fix guess_funcname helper function #18

Closed
joshuadavidthomas opened this issue Feb 24, 2022 · 0 comments · Fixed by #21
Closed

Fix guess_funcname helper function #18

joshuadavidthomas opened this issue Feb 24, 2022 · 0 comments · Fixed by #21

Comments

@joshuadavidthomas
Copy link
Collaborator

The helper function guess_funcname is used in a failed test report to grab the function name that the error occurred.

It works fine in the simple tests contained in this project’s test suite but fails on a real world project (a Django test suite from one of my other projects).

It’s a pretty simple and naive implementation (loop backwards to find the nearest line starting with def ). It should probably be swapped out with something a bit more robust (ast parsing?) and properly tested to ensure we don’t have to rely on a fallback value of ‘???’.

Raised by @fruch in #16

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 a pull request may close this issue.

1 participant