Unit Testing in Python with pytest | Introduction to mock (Part-9)

preview_player
Показать описание
In this video, learn how to mock object in Python for unit testing with Python.

------------------------------------------------------------

More awesome topics covered here:

------------------------------------------------------------

#python #pytest #tutorial
Рекомендации по теме
Комментарии
Автор

This was by far the best video I've seen on pytest and mock. Thank you! Just implemented a ton of these in my tests which cut the code by like 75% and allowed me to do a complete end-to-end test of the platform vs just a few of the functions.

msven
Автор

BEST BEST BEST EXPLANATION. Finally I understood UT's thank you !!!

pratheek
Автор

This is the best learning video on pytests and mock in the history of python content out there, I am very lucky to have discovered this gem. Please make more such videos, also on AI with Python.

yourmirror
Автор

So far I found this tutorial series useful. Instead of magical things, I am learning logical things.

papunmohanty
Автор

Perfectly covered all the topics brother....

SravanKumarduggirala
Автор

Thanks Man ! This is the best explanation of Mock I have found so far. You have reduced my stress a lot.

PrantikPanja
Автор

Excellent explanation! One of the best if not the best I have come across. Thanks :)

iwswordpress
Автор

This is an excellent and to the point explanation. Thanks a lot!

propadovicnenad
Автор

Thanks, But the title said pytest, I thought you are going to mock calls with pytest. But this tutorial is using the unit tests to mock, that is not the expectation from the title.

rsanjay
Автор

Cant thank you enough for this exceptional video. You covered so many scenarios. I was also working on a complex test where I needed to mock some objects which had other functions associated with it that I needed to mock. Using all the learning from your video and after watching is 2 3 times I was able to do that difficult task. I am new to testing too. Great man.

tarvinder
Автор

This is video is super helpful! After a lot of exploration about mock and patch, I came across this video and make the job easy for a data science person who is new to unittest! :) :) Thanks a lot!!

tapojyotipaul
Автор

Hi Nikhil,
This playlist is really good, could you please extend this playlist and include how configuring and use tox for automation in testing. Just wanna know if there is any unit testing framework design specific to a machine learning.

shaz-z
Автор

Excellent video. You are a talented teacher. I am glad I found your video. Many thanks for taking the time to create these.

TJKhara
Автор

Thanks, I need to create pytest for a python program where I am connecting to postgres db and running select query. How to mock a db connection and how to mock other things like query or tables etc. I am confused about the approach to take to test

simplyviki
Автор

What you did at @13.38 to load the code of mock.py

kunallohar
Автор

But you are using the unittest library not fully pytest

kdecibel
Автор

Can't we mock the return_value from get_ip() directly instead of mocking things within the function? For example if I just use the output of get_ip() elsewhere. Is there a difference between the two approaches?

totiqauan
Автор

Great playlist, is there a way to unit test nested functions using pytest?

shubhisrivastava
Автор

Can you upload video on how we can mock functions called outside a method.. in lambda

TheSandyfamily
Автор

@10:21 How are auto importing ?
@Indian Pythonista

RJDev-erbl