You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ‘???’.
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
The text was updated successfully, but these errors were encountered: