How to Write Great Unit Tests in Python
ArjanCodes
0:00 / 0:00
How to Write Great Unit Tests in Python
49 620 просмотров · 1 год назад
ArjanCodes
342 тыс. подписчиков
49 620 просмотров · 1 год назад
Check out https://www.squarespace.com/arjancodes to save 10% off your first purchase of a website or domain using code ARJANCODES.
Want to learn how to write professional, maintainable unit tests in Python? In this video, I’ll walk you through the entire process using a realistic WeatherService example—from basic testing principles to powerful pytest features like monkey patching, mocking, fixtures, and parametrization.
💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide.
🔥 GitHub Repository: https://git.arjan.codes/2025/testtips.
🎓 ArjanCodes Courses: https://www.arjancodes.com/courses.
💬 Join my Discord server: https://discord.arjan.codes.
⌨️ Keyboard I’m using: https://amzn.to/49YM97v.
🔖 Chapters:
0:00 Intro
1:01 The Basics of Unit Testing
3:45 Monkey Patching
8:51 Mocking vs. Monkey Patching
12:20 Using Fixtures
14:01 Refactor for Testability
16:39 Neat Pytest Features
19:59 Best Practices for Writing Unit Tests
22:20 Final Thoughts
#arjancodes #softwaredesign #python