3 ms·
You don’t see comments in a test report though — maybe have an optional description as part of the framework for more detail along with -v
by exdsq 6y ago
You don’t see comments in a test report though — maybe have an optional description as part of the framework for more detail along with -v
- munchbunny 6y agoI think this is one of those conventions where your team agrees on one convention, and you just try to follow it consistently. If that's looking at the test in code to find descriptive comments, great. If that's long test names, cool. Just do the same thing consistently.
- exdsq 6y agoTrue - I think it depends on who uses your test outputs. If PMs and BAs care, having a more verbose output (descriptions, pretty graphs, etc) helps a lot. If it’s just for devs then they can more happily go through the code base.
- nerdponx 6y agoI know that the docstring in Unittest is part of the reported output, and I was pretty sure that it's the same in Pytest.
- masklinn 6y agoI would've thought so but no, pytest will show the docstring in `--collect-only -v` (badly), but it doesn't show any sort of description when running the tests, even in verbose mode (see issue #7005 which doesn't seem to be very popular)
- masklinn 6y ago`unittest` prints the docstring alongside the name of the test in verbose mode (e.g. failure). pytest does not though.