Skip to content

Commit

Permalink
Avoid empty line before error list if verbosity is less than 1
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanholek committed Jan 23, 2021
1 parent 8d153e5 commit cfd4949
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion nose2/plugins/result.py
Expand Up @@ -172,7 +172,8 @@ def _reportSummary(self, event):
errors = cats.get('errors', [])
failures = cats.get('failures', [])
# use evt.stream so plugins can replace/wrap/spy it
evt.stream.writeln('')
if self.session.verbosity > 0:
evt.stream.writeln('')
self._printErrorList('ERROR', errors, evt.stream)
self._printErrorList('FAIL', failures, evt.stream)

Expand Down
11 changes: 5 additions & 6 deletions nose2/tests/functional/test_verbosity.py
@@ -1,13 +1,12 @@
from nose2.tests._common import FunctionalTestCase

_SUFFIX = (
"\n----------------------------------------------------------------------"
"\nRan 1 test "
)
_SUFFIX = """\
----------------------------------------------------------------------
Ran 1 test """

Q_TEST_PATTERN = r"(?<!\.)(?<!ok)" + _SUFFIX
MID_TEST_PATTERN = r"\." + _SUFFIX
V_TEST_PATTERN = r"test \(__main__\.Test\) \.\.\. ok" + "\n" + _SUFFIX
MID_TEST_PATTERN = r"\." + "\n" + _SUFFIX
V_TEST_PATTERN = r"test \(__main__\.Test\) \.\.\. ok" + "\n\n" + _SUFFIX


class TestVerbosity(FunctionalTestCase):
Expand Down

0 comments on commit cfd4949

Please sign in to comment.