Understand Python unit tests in 5 minutes
In this video I show you an overview of unit tests in Python: what they are, how they work and how to write effective ones by looking at real world examples.
Links:
- Python 3 documentation for unit tests: https://docs.python.org/3/library/unittest.html
- md-toc: https://github.com/frnmst/md-toc/
CHAPTERS
0:00 Intro
0:08 Brief explanation
0:51 Steps to setup unit tests
1:12 Directory structure
1:22 tests.py file structure: unittest module, inherited classes, test_ methods
2:27 The strcmp_a function example
2:46 strcmp_a unit tests explained in detail
3:25 Running the tests
3:30 Setting a wrong value in a unit test on purpose to see what happens
3:40 The _replace_string function in md-toc
4:09 _replace_string unit tests
4:33 Running all tests in md-toc
4:53 Lines of code of unit tests compared to the rest of the code in md-toc
5:07 Outtro
#unittests #python #mdtoc
-
1:29:55
Miss Understood With Rachel Uchitel
2 days agoBam Margera Gets Sober & Challenges Johnny Knoxville To BKFC
3.93K3 -
1:40:19
The Quartering
3 hours agoInsane Debate Rules, Dr Disrespect Situation Gets Worse, Star Wars Acolyte Blasted
25.6K26 -
2:13:45
The Shannon Joy Show
7 hours ago🔥Pirate Debate! Tonight RFK Jr. RAIDS The Fake Uniparty Debate - W/ Publisher & Friend Tony Lyons🔥
14.9K44 -
1:12:09
Russell Brand
6 hours agoBREAKING: 5 States SUING Pfizer Over Vaccine Deaths & Tucker EXPLODES on Vaccine Makers - SF 395
127K237 -
2:15:58
TheAlecLaceShow
4 hours agoGuests: AG Andrew Bailey | Dr. Peter McCullough | Dave McCormick | Debate Night | The Alec Lace Show
27.7K1 -
54:21
VIVA TV
4 hours agoHank and Jerry Kick Off The Taylor Made Summer Series With a 1v1
31.4K3 -
44:57
Rethinking the Dollar
4 hours ago"Our Gov't Can't Even Function!" Gold & Silver Talk Not Allowed During The Debate w/ Paul Stone
34.4K5 -
54:33
The Dan Bongino Show
7 hours agoHow The Debate Could Change Everything (Ep. 2279) - 06/27/2024
548K1.65K -
1:26:41
vivafrei
5 hours agoLive with Pantelis - from Trudeau to Poilievre to Trump AND BEYOND!!!
62.5K26 -
1:30:42
Benny Johnson
5 hours agoLet's Get READY To RUMBLE! Trump to Take On Drugged-Up Joe LIVE, DNC PANIC at LANDSLIDE Trump Poll🚨
89.4K356