Sign in to confirm you’re not a bot
This helps protect our community. Learn more
Python Tutorial: Unit Testing Your Code with the unittest Module
26KLikes
1,429,063Views
2017Aug 16
In this Python Programming Tutorial, we will be learning how to unit-test our code using the unittest module. Unit testing will allow you to be more comfortable with refactoring and knowing whether or not your updates broke any of your existing code. Unit testing is a must on any large projects and is used by all major companies. Not only that, but it will greatly improve your personal code as well. Let's get started. The code from this video can be found at: https://github.com/CoreyMSchafer/code... Unittest assert methods: https://docs.python.org/3/library/uni... if _name_ == '__main__' video:    • Python Tutorial: if __name__ == '__ma...   OOP Series:    • Python OOP Tutorials - Working with C...   ✅ Support My Channel Through Patreon:   / coreyms   ✅ Become a Channel Member:    / @coreyms   ✅ One-Time Contribution Through PayPal: https://goo.gl/649HFY ✅ Cryptocurrency Donations: Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3 Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33 Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot ✅ Corey's Public Amazon Wishlist http://a.co/inIyro1 ✅ Equipment I Use and Books I Recommend: https://www.amazon.com/shop/coreyschafer ▶️ You Can Find Me On: My Website - http://coreyms.com/ My Second Channel -    / coreymschafer   Facebook -   / coreymschafer   Twitter -   / coreymschafer   Instagram -   / coreymschafer   #Python

Follow along using the transcript.

Corey Schafer

1.42M subscribers

Python Programming Beginner Tutorials

1

Python Tutorial for Beginners 1: Install and Setup for Mac and Windows

Corey Schafer
2

Python Tutorial for Beginners 2: Strings - Working with Textual Data

Corey Schafer
3

Python Tutorial for Beginners 3: Integers and Floats - Working with Numeric Data

Corey Schafer
4

Python Tutorial for Beginners 4: Lists, Tuples, and Sets

Corey Schafer
5

Python Tutorial for Beginners 5: Dictionaries - Working with Key-Value Pairs

Corey Schafer
6

Python Tutorial for Beginners 6: Conditionals and Booleans - If, Else, and Elif Statements

Corey Schafer
7

Python Tutorial for Beginners 7: Loops and Iterations - For/While Loops

Corey Schafer
8

Python Tutorial for Beginners 8: Functions

Corey Schafer
9

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

Corey Schafer
10

Python Tutorial: OS Module - Use Underlying Operating System Functionality

Corey Schafer
11

Python Tutorial: File Objects - Reading and Writing to Files

Corey Schafer
12

Python Tutorial: How to Set the Path and Switch Between Different Versions/Executables (Windows)

Corey Schafer
13

Python Tutorial: How to Set the Path and Switch Between Different Versions/Executables (Mac & Linux)

Corey Schafer
14

Python Tutorial: Automate Parsing and Renaming of Multiple Files

Corey Schafer
15

Python Tutorial: CSV Module - How to Read, Parse, and Write CSV Files

Corey Schafer
16

Python Tutorial: Real World Example - Parsing Names From a CSV to an HTML List

Corey Schafer
17

Python Tutorial: Datetime Module - How to work with Dates, Times, Timedeltas, and Timezones

Corey Schafer
18

Python Tutorial: Variable Scope - Understanding the LEGB rule and global/nonlocal statements

Corey Schafer
19

Python Tutorial: Sorting Lists, Tuples, and Objects

Corey Schafer
20

Python Tutorial: Using Try/Except Blocks for Error Handling

Corey Schafer

Python Tutorial: Unit Testing Your Code with the unittest Module

Corey Schafer
22

Python Tutorial: Pipenv - Easily Manage Packages and Virtual Environments

Corey Schafer
23

Python Requests Tutorial: Request Web Pages, Download Images, POST Data, Read JSON, and More

Corey Schafer
24

Python Tutorial: VENV (Mac & Linux) - How to Use Virtual Environments with the Built-In venv Module

Corey Schafer
25

Python Tutorial: VENV (Windows) - How to Use Virtual Environments with the Built-In venv Module

Corey Schafer
26

5 Common Python Mistakes and How to Fix Them

Corey Schafer