Improve your testing with Pytest and Mock - PyCon SG 2015

preview_player
Показать описание
Speaker: Gabe Hollombe

Testing code with Pytest is an absolute pleasure. Less boilerplate makes your test more concise and its fixtures system helps you share setup code while still keeping your tests clear and understandable. I'll tell you all about how to get basic unit testing done, and I'll show you how to use Voidspace's Mock library to test collaborations between your objects, too.

Produced by Engineers.SG
Рекомендации по теме
Комментарии
Автор

I hate lectures about testing, but this has really been a pleasure. Tnx Gabe!

mtnrabi
Автор

Great talk, a big help for learning to use pytest, which I'm currently going through.
One point to note, in the 'Fixtures' example, the class method 'greet' will need the 'self' argument for this code to work.
Overall, a clear and useful talk. Thanks

geoptus
Автор

Great talk! I'm just getting started with testing and this helped me understand the concepts that I was getting hung up on.

StankyPickle
Автор

Note: pytest-mock is like the best of both worlds and gets around nested context managers.

Babs
Автор

That explanation of "spec" at ~21:50 didn't make sense to me

_coniferous