5 ms·
Pretty much anybody with big modern project i know in the industry is using pytest. It make the barrier of entry of writting tests much lower. Given how annoyi
by sametmax 9y ago
Pretty much anybody with big modern project i know in the industry is using pytest.
It make the barrier of entry of writting tests much lower. Given how annoying it is to write test, i'd say making it even a tiny bit easier is a win.
Plus fixtures scale better than tearUp and down.
- allover 9y agoHmm I'm in the camp that believes setUp/tearDown and fixtures are not only equivalent, but both antipatterns. This article explains it better than I can [1] [1] https://robots.thoughtbot.com/lets-not https://robots.thoughtbot.com/lets-not
- bpicolo 9y agopytest fixtures don't have that issue, as they're only run when you include the fixture for DI
- allover 9y ago> pytest fixtures don't have that issue, as they're only run when you include the fixture for DI I don't see how that prevents any of the basic problems raised in the article.
- makmanalp 9y agopy.test avoids XUnit or unittest style class-based tests for this reason (though it will run them if you insist). It opts for simple test functions instead. Fixtures are passed in explicitly as parameters rather than implicitly as class members or whatnot. The result of all this is quite similar to what the author proposes.
- drcongo 9y agoPytest with Mixer [1] really lowers the barrier to entry. [1] https://mixer.readthedocs.io https://mixer.readthedocs.io