-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
AFAICT this ability doesn't exist.
I have a parameterized test that sometimes receives params that are long strings. I would generally prefer verbose output, but the long strings really clutter up the output pretty badly.
For example:
strings_list = [
# Imagine several of these
(
"""Imagine a whole paragraph here.""",
"""Imagine a whole paragraph here.""",
),
]
pytest.mark.parametrize(["content", "expected"], string_list)
def test_sample(content, expected):
....Testing the above with pytest -v Will print the entirety of the long strings used in string_list. Normally this is just what I want, and the output for each line fits nicely on a single line, or maybe a little spill over to two. With long params though, this creates a mess that makes it more difficult to understand the total results of the test at a glance, and needs a lot more scrolling to get through.
Nonetheless, a hint to the params would be great. I suggest, to not change current behavior, the ability to decorate or otherwise mark specific tests to affect this behavior for just that test.
Alternatives:
- A global setting to change this behavior (a good supplement)
- Actually changing the default behavior of
-v. I'd guess this isn't a welcome option.