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

Improve error message for @working_directory decorator #56

Open
shawnbrown opened this issue May 23, 2021 · 0 comments
Open

Improve error message for @working_directory decorator #56

shawnbrown opened this issue May 23, 2021 · 0 comments

Comments

@shawnbrown
Copy link
Owner

If working_directory() is used as a decorator but the developer forgets to call it with a path, the error message can be confusing because the function is passed in implicitly (via decorator handling):

>>> from datatest import working_directory
>>>
>>> @working_directory
>>> def foo():
>>>     return True
...
TypeError: stat: path should be string, bytes, os.PathLike or integer, not function

This misuse is easily detectable in the code and it would be good to improve the error message to help users understand their mistake.

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

No branches or pull requests

1 participant