Better error messages for hypothesis write <some_filename>
#3404
Labels
legibility
make errors helpful and Hypothesis grokable
hypothesis write <some_filename>
#3404
The Ghostwriter CLI expects to be passed a module name (e.g.
hypothesis write gzip
), or dotted path to a callable (e.g.hypothesis write numpy.matmul
). We also include the current directory in the python path, so that you can pass e.g.myscript
.If you try passing a filename instead, this doesn't work - whether
myscript.py
orpath/to/myscript.py
. I don't want to make that work, but we could have better error messages:hypothesis write myscript.py
fails withError: Found the 'script' module, but it doesn't have a 'py' attribute.
In this case, we should add "\n Remember that the ghostwriter should be passed the name of a module, not a file"hypothesis write src/myscript.py
fails withError: Invalid value for 'FUNC...': my/script.py
. We should add a similar explicit error message.The text was updated successfully, but these errors were encountered: