Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
pytester is lacking documentation #3833
Many important methods missing from the docs, such as
Hi @wimglenn thanks for the report.
Indeed pytester docs is declared in the reference listing the members explicitly:
.. autoclass:: Testdir() :members: runpytest,runpytest_subprocess,runpytest_inprocess,makeconftest,makepyfile
I think it could be changed to just
Would you like to contribute a PR?
OK, I've created the PR. Hit a few roadblocks on the way. Removing the
After much head scratching, I eventually figured the docstring is getting double-parsed. Python applies backslash processing to convert \n to a new line character in the docstring itself! So, in this line, there appears an invalid unindent after the \n. The solution is to escape the backslash (e.g. adding the r prefix on the docstring). I also changed it to be hopefully more consistent with the style of other docs.
Next roadblock: pytest's pre-commit hook was not working.
This one was easier to figure. The file
OK, I don't care, I committed the change with
Thanks a lot @wimglenn, appreciate it!
That's a good idea, but I don't think pre-commit can handle that, because it works on commit basis, so it can't know if the branch will get a proper changelog entry later for example. Probably the best approach here is to have a towncrier bot of sorts instead.
I could imagine this being possible through a pre-push hook (which is supported by
referenced this issue
Aug 20, 2018
Yeah, and users might always forget to install the pre-commit hook. We could also check that during linting, but it is also hard to get it right.
A bot really seems to be the proper solution, but AFAIK a "towncrier bot" doesn't exist (disclaimer: zero research done at this point