Introduction to Unit Tests in Python | Tutorial

preview_player
Показать описание
☆☆ ABOUT THIS VIDEO ☆☆
We use the built in Unit Test module "unittest" to test a very simple function. This video will help you get started writing automated tests in general. We only cover unit testing here. I also introduce you to "Assume/Action/Assert" which is a really good way to layout your tests.

☕️ You can buy me a coffee by supporting this video on Patreon:

👨‍💻 The final code can be found on Github:

🐍 More Python tutorials from me:

Python Exercise - Fetch lyrics from an API and parse the JSON

Getting started with Classes in Python:

2 - 3 min Developer Quick Tips Series:

😊You can find me here:

☆☆ SPONSORSHIP ☆☆
Does your company want to sponsor a video? Contact me by twitter or LinkedIn
Рекомендации по теме
Комментарии
Автор

Upvoted for no shitty music during tutorial. I can put my own over this, and it is very helpful. Thanks for the video!

borreLore
Автор

How would you test a function that does not return anything?

EchoVidsu
Автор

Can you share a gist to this code? That is helpful for people to follow along with.

JoshSistoplus
Автор

Thank you for the quick and helpful video! You mentioned that you can auto-run unit tests but you didn't describe the IDE that you're using. What is it?

AmandaGaudreauBalderrama
Автор

So you tell me unit test is writing code to test my code by the same cases i can test using regular inputs ?
what time does this save man ?

mosabawad
Автор

Thanks!, it worked. I was following a code in a guide a friend gave me and the test file is the same except that at the end there is a unittest.main() outside of the class but it doesn't work with that line. Do you know what that line could be for? maybe an old version of pyton?

francovenica