News for hackers. Stuff that matters.
Re:Ask HN: What is your preferred Python 3 testing framework? by sametmax on Sunday November 05, 2017 @08:45AM (#15629328)
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.

Re:Ask HN: What is your preferred Python 3 testing framework? by allover on Sunday November 05, 2017 @10:04AM (#15629704)
Hmm 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

Re:Ask HN: What is your preferred Python 3 testing framework? by bpicolo on Sunday November 05, 2017 @10:11AM (#15629742)
pytest fixtures don't have that issue, as they're only run when you include the fixture for DI
Re:Ask HN: What is your preferred Python 3 testing framework? by allover on Sunday November 05, 2017 @11:22AM (#15630059)
> 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.

Re:Ask HN: What is your preferred Python 3 testing framework? by makmanalp on Sunday November 05, 2017 @12:06PM (#15630297)
py.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.
Re:Ask HN: What is your preferred Python 3 testing framework? by drcongo on Monday November 06, 2017 @04:50AM (#15634415)
Pytest with Mixer [1] really lowers the barrier to entry.

[1] https://mixer.readthedocs.io

Re:Ask HN: What is your preferred Python 3 testing framework? by sametmax on Monday November 06, 2017 @08:09AM (#15635145)
Nice. How does it compare to factory boy ?
Re:Ask HN: What is your preferred Python 3 testing framework? by drcongo on Tuesday November 07, 2017 @05:08PM (#15648120)
Sorry for the late reply, I reckon I've more than halved the amount of set up code I have to write by switching to Mixer.