GitHub Repository: https://github.com/chuckconway/yt_202...
Are you curious about unit testing in Python? In this video, I, guide you through creating your first unit test and using mocks to test your code effectively. Starting with the basics of defining a unit test, structuring it using the 'Arrange, Act, Assert' pattern, and naming conventions, Chuck then explains mocking and its implementation. The video also covers asynchronous testing with async mocks, using the Python patch decorator for intercepting calls, and running tests from the command line. Perfect for beginners looking to enhance their Python testing skills.
MY OTHER SOCIALS
My website & blog - https://chuckconway.com
Twitter - https://x.com/chuckconway
LinkedIn - / chuckconway
Threads - https://www.threads.net/@chuckconwayjr
Instagram - / chuckconwayjr
WHO AM I?
Hi, I'm Chuck, I've spent 3 decades as a software engineer. I share software engineering insights and use my experience with AI to create elegant solutions.
I live in Folsom, CA, with my wife Erin, my daughter, and our cat Mango.
Timestamps:
00:00 Introduction to Unit Testing in Python
00:27 Setting Up Your First Unit Test
01:52 Structuring Your Tests: Arrange, Act, Assert
03:29 Naming Conventions for Tests
04:28 Introduction to Mocking
07:32 Using Async in Tests
14:44 Understanding Patch Decorator
17:50 Running Your Unit Tests
18:42 Conclusion