Is there a way to configure failed tests verbosity?

I have an issue about the verbosity of a failed test. When I have a failing test case, I obtain the following result:

Testing started at 13:54 ...
/usr/bin/python3.7 /home/jordi/aplicaciones/PyCharm/plugins/python-ce/helpers/pycharm/_jb_pytest_runner.py --target test_project_loader.py::TestProjectLoader.test_loading_local_plugins_when_plugins_directory_is_empty
Launching pytest with arguments test_project_loader.py::TestProjectLoader::test_loading_local_plugins_when_plugins_directory_is_empty in /home/jordi/sources/cpm/test/domain

============================= test session starts ==============================
platform linux -- Python 3.7.3, pytest-5.1.2, py-1.8.0, pluggy-0.12.0 -- /usr/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/jordi/sources/cpm
collecting ... collected 1 item

test_project_loader.py::TestProjectLoader::test_loading_local_plugins_when_plugins_directory_is_empty FAILED [100%]
test/domain/test_project_loader.py:156 (TestProjectLoader.test_loading_local_plugins_when_plugins_directory_is_empty)
None != []

Expected :[]
Actual :None
<Click to see difference>

self = <test.domain.test_project_loader.TestProjectLoader testMethod=test_loading_local_plugins_when_plugins_directory_is_empty>

def test_loading_local_plugins_when_plugins_directory_is_empty(self):
filesystem = mock.MagicMock()
yaml_handler = mock.MagicMock()
loader = ProjectLoader(yaml_handler, filesystem)
filesystem.list_directories.return_value = []

plugins = loader.load_local_plugins()

> assert plugins == []
E AssertionError: assert None == []

test_project_loader.py:165: AssertionError


=================================== FAILURES ===================================
_ TestProjectLoader.test_loading_local_plugins_when_plugins_directory_is_empty _

self = <test.domain.test_project_loader.TestProjectLoader testMethod=test_loading_local_plugins_when_plugins_directory_is_empty>

def test_loading_local_plugins_when_plugins_directory_is_empty(self):
filesystem = mock.MagicMock()
yaml_handler = mock.MagicMock()
loader = ProjectLoader(yaml_handler, filesystem)
filesystem.list_directories.return_value = []

plugins = loader.load_local_plugins()

> assert plugins == []
E AssertionError: assert None == []

test_project_loader.py:165: AssertionError
============================== 1 failed in 0.05s ===============================

Process finished with exit code 0

Assertion failed

Assertion failed

Assertion failed

Assertion failed

Assertion failed

I'm not sure about who's generating all this information but, as you can see, the output is very noisy and the actual problem is hard to spot. It would be great to have an option to show a less verbose output:

test/domain/test_project_loader.py:156:

Expected :[]
Actual :None

I'm not saying that the output should be necessarily this one, just something more concise and focused on the actual problem.

Please sign in to leave a comment.