[Numpy-discussion] pytest, fixture and parametrize (original) (raw)
Chris Barker - NOAA Federal chris.barker at noaa.gov
Wed Aug 8 12:05:10 EDT 2018
- Previous message (by thread): [Numpy-discussion] pytest, fixture and parametrize
- Next message (by thread): [Numpy-discussion] Stacklevel for warnings.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
as to whether we are should use pytest fixtures and parametrized classes and functions.
Absolutely!
the disadvantage is being dependent on pytest as unittest does not support that functionality.
Which is the whole point of using pytest, yes?
I’m very opinionated about this, but I really dislike unittest — it’s simply way too Java-y — makes the easy things harder than they should be, and is missing critical should-be-easy features.
I moved to pure pytest a few years ago, and have been very happy about it. In fact, I recently converted some d unittest code to pure pytest, and it was literally about 1/4 as much code.
The only reason I can see to avoid pytest features is that it’s not in the standard lib — but it’s not a run-time dependency, and it’s easy to install and well supported — so all good.
I suppose we may want to avoid some of pytest’s more magical esoteric features, but certainly not core functionality like fixtures and parameterized tests.
-CHB
- Previous message (by thread): [Numpy-discussion] pytest, fixture and parametrize
- Next message (by thread): [Numpy-discussion] Stacklevel for warnings.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]