Pytest is new to me. We try to verify that we have all expected files in a project.
I like every part of the pytest output except for the detailed FAILURES that will confuse our non-programmers.
How can we suppress the FAILURES output?
Current code:
import os.path
import pytest
spec = {"expected_files": ["Dockerfile", "Duckerfile", "Daskerfile"]}
@pytest.mark.parametrize("expected_file", spec['expected_files'])
def test_expected_file_is_in_project(expected_file):
assert os.path.isfile(expected_file), "File \""+expected_file+"\" not found in project"
Output after running the "pytest -v" command

You may run pytest with the traceback (tb) option set to no in order to suppress the traceback reporting, i.e.:
pytest --tb=no
Check out the Modifying Python traceback printing section of the pytest documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With