Closed paxcodes closed 3 years ago
Another output I didn't expect:
Given a parametrized test,
class Test_Something:
@mark.parametrize(
"givenDateTime, expectedStartDate, expectedEndDate",
[
(
"2021-03-19 03:00:01",
datetime(2021, 3, 12, 3, 0, 0, 0),
datetime(2021, 3, 19, 3, 0, 0, 0),
),
]
)
def test_me(self, givenDateTime: str, expectedStartDate: datetime, expectedEndDate: datetime): ...
Actual Output
Something:
✓ Me
Expected Output
Something:
✓ Me ["2021-03-19 03:00:01", datetime(2021, 3, 12, 3, 0, 0, 0), datetime(2021, 3, 19, 3, 0, 0, 0)]
Hello,
Thank you @paxcodes for reporting issue. I was able to reproduce your problem, Let's investigate them one by one.
Regarding first test problem the issue is not related to pytest-spec
plugin but pytest
itself.
To see that please execute two commands:
pytest --spec
pytest -v --spec
The second command will show you how pytest is tagging your parametrize cases. Output in pytest
and pytest-spec
are the same. I cannot change this because I'm getting such information from pytest
.
Regarding second case I have a problem with your example because I have this output:
✓ Me[2021-03-19 03:00:01-expectedStartDate0-expectedEndDate0]
The name is strange but such name I received from pytest
Please discuss parametrize
issue with pytest developers. Good luck.
Problem Parameterized tests with tuples should output tuples.
To Reproduce
Actual Output
Expected Output