7 ms·
Pytest-austin: performance regression testing with no instrumentation
- LiamPa 6y agoYesterday I was wondering if anything like this existed after accidentally adding 100 duplicate database requests on a Django endpoint.
- JackC 6y agodjango_assert_num_queries is helpful for this as well -- basically any time I'm writing a test for something where I've spent time thinking about query efficiency in the first place, I'll throw in an assert. (I actually use a homerolled version that can log the location of the queries with -v, but same idea.) https://pytest-django.readthedocs.io/en/latest/helpers.html#django-assert-num-queries https://pytest-django.readthedocs.io/en/latest/helpers.html#...
- JackC 6y agoHas anyone used something like this to report performance regressions? I don't as much want to assert that performance stays below X seconds on particular tests, and more want a report on pull requests if any tests regressed more than X%, the same way I currently get CI reports for coverage regressions.
- miohtama 6y agoI hope TypeScript community will come up with something as powerful as py.test soon. Fixtures keep your wrists agony free when writing tests. Asserts are joy to read. Decorators make everything readable. Plugin system has a solution for everything. Meanwhile in the JS land I.cannot().keep.guessing().what().crap().to.chain.or.not().
- nunez 6y agopytest is awesome, but I wish pytest were more like rspec. In my opinion, rspec is THE BEST testing framework out there.
- travisjungroth 6y agoIsn’t the built in unittest based on rspec?
- miohtama 6y agoJest and power asserts is what I use now. It is the best you get but still an order of magnitude behind py.test
- emptysea 6y agoHave you tried https://jestjs.io/ https://jestjs.io/? It doesn't have as crazy of chaining like Mocha and has snapshots which I sometimes miss when using pytest.