CleanCut / green

Green is a clean, colorful, fast python test runner.
MIT License
785 stars 75 forks source link

green -vv does not print test docstrings #210

Closed kryft closed 4 years ago

kryft commented 4 years ago

I just installed green 2.16.1, and green -vv doesn't print test method docstrings. For instance, with test_foo.py from the readme, the output for green -vv is this:

test_foo
  TestAnswer
.   test_expected
.   test_type
  TestSchool
.   test_age
.   test_food

If I set the verbosity level to 3 with green -vvv, it does print the docstrings.

CleanCut commented 4 years ago

Correct, that is the design of the verbosity levels:

verbosity=1 (default)

verbosity=2 (-vv)

verbosity=3 (-vvv)

Perhaps we need to make that explicit in the help output?

kryft commented 4 years ago

Ah, ok, then the sample command in the Quickstart section of the readme must have a typo (the command has -vv, but it should have -vvv to be consistent with the output):

$ green -vv proj
proj.test.test_foo
  TestAnswer
.   answer() returns 42
.   answer() returns an integer
  TestSchool
.   test_age
.   test_food

Ran 4 tests in 0.001s

OK (passes=4)

I guess it wouldn't hurt if green -h mentioned this as well, but probably just fixing the typo in the readme will go a long way. :)

(I actually thought it wasn't a typo because IIRC - can't check right now - green -h said that the recommended verbosity levels are 1 and 2, so I figured that surely the readme would show an example of typical - recommended - usage, and there must be some weird bug here. :)

CleanCut commented 4 years ago

Good catch! That section of the README hasn't been touched in over 5 years, and one of the early versions of green only had 2 verbosity levels.

kryft commented 4 years ago

Ah, that makes sense. :)

CleanCut commented 4 years ago

Fixed. Updated the screenshots as well, for good measure.