I plan to use pytest, but I would like to know the pros and cons.
For further actions, you may consider blocking this person and/or reporting abuse
I plan to use pytest, but I would like to know the pros and cons.
For further actions, you may consider blocking this person and/or reporting abuse
Shittu Olumide -
Sathnindu Kottage -
Scofield Idehen -
Developer Service -
Top comments (5)
I prefer pytest over unittest. The pros are:
conftest.py
mechanism allows you to group setups that are evaluated only at necessity in a cascading fashion in sub foldersassert
andwith
)the cons are:
I agree with everything here, except I actually found pytest fixtures to be pretty intuitive.
Thank you for your very valuable opinion!
This is exactly what I was looking for.
The disadvantages seemed to be fine for me,
I would like to verify using pytest.
I don’t practice TDD, but for testing python I’ve been using unittest along with MyPy. MyPy is a huge help in writing good working code and I can’t recommend it enough. It’s very very very far from perfect but it’s also light years ahead of the frustrating buggy mess of trying to write completely untyped code.
Thank you for your valuable feedback!
I am a python beginner.
I didn't know Mypy, so it was helpful. Thank you again.
I am trying to verify TDD with reference to the unittest code created by my colleague.
If there are advantages to using pytest, I will change to pytest.