Professional Python Testing with Mocks

preview_player
Показать описание
In this video, we learn how to professionally test Python code with mocks.

◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚

💼 Services 💼

🌐 Social Media & Contact 🌐
Рекомендации по теме
Комментарии
Автор

English is my second language and the explainings are so clear that I understood everything in this tutorial. Very well explained and examplified. Thank you so much.

joaovitorfrossard
Автор

Most people don't use mocks and they just hope that the database or the internet or whatever other service works during the test run phase. A good use case is when there is expected to get a reponse from the user like in the input() function, the test would just wait until someone input some data and press enter. Mocking the input() function allows the test to run uninterrupted.

JorgeEscobarMX
Автор

This is now my GO TO channel for python. Absolutely top class tutorials!

ted
Автор

the explanation from beginning is awesome mahn! Very concise

justmogen
Автор

You're my champion from now on dude. Great vid

highradqa
Автор

Very well explained. Please come up with more such videos and examples. Thanks .

mohitmansi
Автор

The introduction was excellent. But then I do not understand the first example. The individual lines are not really very well explained.
How does the assert_called_with work, and why does it send an error?

eugenmalatov
Автор

Also, to test error conditions it's great to use mocks on the dependencies

CristianMolina
Автор

thank you for the nice video. if I use pytest, what is the mock lib you recommend?

GigiSher-tdzs
Автор

That was sensational, feeling 🏋️‍♀️🏋️‍♀️

thee_apedo_guy
Автор

What is MagicMock? Can you show small demo with it?

Deepu
Автор

this was very helpful. Is there a follow up video for more such examples? thanks

dsinghr
Автор

Very good. I would like to see more videos about mocks but using magic mock

allandasantos
Автор

A little chaotic and the examples were very well done.

JorgeEscobarMX
Автор

Feels like you understand how this works, but you don't understand how to explain it to me. From what I do understand, you seem to be waaaay oversimplifying the example for the sake of speed, when I as a person new to this need things to be a little more fleshed out and verbose to be able to follow what's going on.

codyswanner
Автор

That assertEqual, for the first example using requests, is bad code. Testing that the value used in the mock is the value returned from the mocked call is nonsensical. Equivalent to testing that 1 == 1. Useless tests are worse than no tests.

HandyAndyG
Автор

dw mate, noone saw you checking the code on the right side screen..😂 nice content btw

masoooomx
Автор

that wasn't good example to teach mock 👎

mazaheri.pourya