Ask HN: What is your preferred Python 3 testing framework?
1–10 of 46 posts
Re: Ask HN: What is your preferred Python 3 testing framework?
#2https://docs.pytest.org/en/latest/
The dependency injection for fixtures is somewhat of a magical entity, but overall I've found it's the most efficient way to hammer out good tests on the standard unit/integration test spectrum. The default mode of operation doesn't even require importing pytest: Just write files named ending with `_test.py`, functions starting with `test`, and bare bones assertions. `yield_fixture` works well with the typical mock-and-assert-on python test pattern.
Plenty of plugins out there for more exotic features, like asyncio, parallelization (though test parallelization tends to be much more problematic beyond "run tests at the same time"), output to , etc too.
Re: Ask HN: What is your preferred Python 3 testing framework?
#3Used for CI in https://github.com/serprex/aespython
Re: Ask HN: What is your preferred Python 3 testing framework?
#4Re: Ask HN: What is your preferred Python 3 testing framework?
#5Re: Ask HN: What is your preferred Python 3 testing framework?
#6Re: Ask HN: What is your preferred Python 3 testing framework?
#7pytest: https://docs.pytest.org/en/latest/ The dependency injection for fixtures is somewhat of a magical entity, but overall I've found it's the most efficient way to hammer out good tests on the standard unit/integration test spectrum. The default mode of operation doesn't even require importing pytest: Just write files named ending with `_test.py`, functions starting with `test`, and bare bones assertions. `yield_…
Re: Ask HN: What is your preferred Python 3 testing framework?
#8pytest: https://docs.pytest.org/en/latest/ The dependency injection for fixtures is somewhat of a magical entity, but overall I've found it's the most efficient way to hammer out good tests on the standard unit/integration test spectrum. The default mode of operation doesn't even require importing pytest: Just write files named ending with `_test.py`, functions starting with `test`, and bare bones assertions. `yield_…
Just an FYI, normal fixtures can use 'yield', there is no need to use 'yield_fixture' anymore
Re: Ask HN: What is your preferred Python 3 testing framework?
#9pytest: https://docs.pytest.org/en/latest/ The dependency injection for fixtures is somewhat of a magical entity, but overall I've found it's the most efficient way to hammer out good tests on the standard unit/integration test spectrum. The default mode of operation doesn't even require importing pytest: Just write files named ending with `_test.py`, functions starting with `test`, and bare bones assertions. `yield_…
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?
#10pytest: https://docs.pytest.org/en/latest/ The dependency injection for fixtures is somewhat of a magical entity, but overall I've found it's the most efficient way to hammer out good tests on the standard unit/integration test spectrum. The default mode of operation doesn't even require importing pytest: Just write files named ending with `_test.py`, functions starting with `test`, and bare bones assertions. `yield_…