Professional Python Testing with Mocks

  Рет қаралды 44,412

NeuralNine

NeuralNine

Жыл бұрын

In this video, we learn how to professionally test Python code with mocks.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine.com/books/
💻 The Algorithm Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
💼 Services 💼
💻 Freelancing & Tutoring: www.neuralnine.com/services
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎙 Discord: / discord

Пікірлер: 25
@20ted09
@20ted09 9 ай бұрын
This is now my GO TO channel for python. Absolutely top class tutorials!
@sadikplayz976
@sadikplayz976 Жыл бұрын
This channel is underrated AF!
@justmogen7383
@justmogen7383 8 ай бұрын
the explanation from beginning is awesome mahn! Very concise
@joaovitorfrossard7317
@joaovitorfrossard7317 4 ай бұрын
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.
@JorgeEscobarMX
@JorgeEscobarMX Жыл бұрын
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.
@ButchCassidyAndSundanceKid
@ButchCassidyAndSundanceKid Жыл бұрын
Very well explained. Thanks.
@highradqa
@highradqa Ай бұрын
You're my champion from now on dude. Great vid !!!!!!!
@geordiehowell9087
@geordiehowell9087 9 ай бұрын
such great explanation. thank you
@JorgeEscobarMX
@JorgeEscobarMX Жыл бұрын
A little chaotic and the examples were very well done.
@mohitmansi11
@mohitmansi11 5 ай бұрын
Very well explained. Please come up with more such videos and examples. Thanks .
@allandasantos9680
@allandasantos9680 7 ай бұрын
Very good. I would like to see more videos about mocks but using magic mock
@thee_apedo_guy
@thee_apedo_guy 3 ай бұрын
That was sensational, feeling 🏋️‍♀️🏋️‍♀️
@CristianMolina
@CristianMolina 5 ай бұрын
Also, to test error conditions it's great to use mocks on the dependencies
@eugenmalatov5470
@eugenmalatov5470 2 ай бұрын
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?
@dsinghr
@dsinghr 3 ай бұрын
this was very helpful. Is there a follow up video for more such examples? thanks
@Deepu1014
@Deepu1014 6 ай бұрын
What is MagicMock? Can you show small demo with it?
@alavvaf
@alavvaf 2 ай бұрын
thanks
@philtoa334
@philtoa334 Жыл бұрын
Thx_.
@vitorsouza6604
@vitorsouza6604 6 ай бұрын
That was quite confusing.
@HandyAndyG
@HandyAndyG Жыл бұрын
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.
@aflous
@aflous Жыл бұрын
Not really, you're testing against regressions here. There are so many ways in which the client code could change to break this assumption
@mazaheri.pourya
@mazaheri.pourya 8 ай бұрын
that wasn't good example to teach mock 👎
@Confusedcapybara8772
@Confusedcapybara8772 6 ай бұрын
Can you provide a video for a better one?
@codyswanner6064
@codyswanner6064 Ай бұрын
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.
Intro to Python Mocks | Python tutorial
18:42
Red Eyed Coder Club
Рет қаралды 79 М.
How To Write Unit Tests For Existing Python Code // Part 1 of 2
25:07
Wait for the last one! 👀
00:28
Josh Horton
Рет қаралды 146 МЛН
MEGA BOXES ARE BACK!!!
08:53
Brawl Stars
Рет қаралды 36 МЛН
I wish I could change THIS fast! 🤣
00:33
America's Got Talent
Рет қаралды 116 МЛН
The day of the sea 🌊 🤣❤️ #demariki
00:22
Demariki
Рет қаралды 106 МЛН
Debugging 101: Replace print() with icecream ic()
12:36
NeuralNine
Рет қаралды 359 М.
Thoughts About Unit Testing | Prime Reacts
11:21
ThePrimeTime
Рет қаралды 211 М.
Python Tutorial: Unit Testing Your Code with the unittest Module
39:13
Corey Schafer
Рет қаралды 1,3 МЛН
Unit Testing in Python
26:25
NeuralNine
Рет қаралды 21 М.
Unit Testing in Python with pytest | Introduction to mock (Part-9)
30:09
Indian Pythonista
Рет қаралды 76 М.
Mocking Strategies in Python
43:42
Excella
Рет қаралды 32 М.
Python TDD Workflow - Unit Testing Code Example for Beginners
25:33
Python Simplified
Рет қаралды 74 М.
Python's 5 Worst Features
19:44
Indently
Рет қаралды 103 М.
How To Write Unit Tests in Python • Pytest Tutorial
35:34
pixegami
Рет қаралды 132 М.
Klavye İle Trafik Işığını Yönetmek #shorts
0:18
Osman Kabadayı
Рет қаралды 160 М.
Choose a phone for your mom
0:20
ChooseGift
Рет қаралды 6 МЛН
Спутниковый телефон #обзор #товары
0:35
Product show
Рет қаралды 2,2 МЛН
⚡️Супер БЫСТРАЯ Зарядка | Проверка
1:00