From 3852f12091a6eeba1b0896257cee1e33b1a9d53f Mon Sep 17 00:00:00 2001 From: toofar Date: Sat, 24 Aug 2024 21:22:58 +1200 Subject: [PATCH] Don't list each screenshot name in pytest report This bit is printed right about the test result summary, so now that the file names are just test names, printing them out just above the full test paths in the results seems a bit redundant. The section header prints out the file path with the screenshots and that's the important part. It looks fine to me printing a section header without any section contents. Example: -------------------- End2end screenshots available in: /tmp/pytest-of-user/pytest-108/pytest-screenshots --------------------- =================================================== short test summary info ==================================================== FAILED tests/end2end/features/test_completion_bdd.py::test_deleting_an_ornpen_tab_via_the_completion - AssertionError: assert 'http://local...ata/hello.txt' == 'http://local...ata/sello.txt' FAILED tests/unit/utils/test_resources.py::TestReadFile::test_glob_deleting_resources_subdir[True-pathlib] - AssertionError: assert ['html/subdir...ir-file.html'] == ['html/subdir...ir-sile.html'] FAILED tests/unit/utils/test_resources.py::TestReadFile::test_glob_deleting_resources_subdir[False-zipfile] - AssertionError: assert ['html/subdir...ir-file.html'] == ['html/subdir...ir-sile.html'] FAILED tests/unit/utils/test_resources.py::TestReadFile::test_glob_deleting_resources_subdir[True-zipfile] - AssertionError: assert ['html/subdir...ir-file.html'] == ['html/subdir...ir-sile.html'] FAILED tests/end2end/features/test_utilcmds_bdd.py::test_cmdrepeatlast_with_modeswitching_command_deleting - AssertionError: assert 'http://local...ata/hello.txt' == 'http://local...ata/sello.txt' FAILED tests/unit/utils/test_resources.py::TestReadFile::test_glob_deleting_resources_subdir[False-pathlib] - AssertionError: assert ['html/subdir...ir-file.html'] == ['html/subdir...ir-sile.html'] =========================================== 6 failed, 23 passed, 8 skipped in 22.59s =========================================== --- tests/conftest.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 15607b6a1..89f32fed1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -399,5 +399,3 @@ def pytest_terminal_summary(terminalreporter): terminalreporter.ensure_newline() screenshot_dir = screenshots[0].parent terminalreporter.section(f"End2end screenshots available in: {screenshot_dir}", sep="-", blue=True, bold=True) - for screenshot in screenshots: - terminalreporter.line(screenshot.parts[-1])