Skip to Content
Daniel Arbuckle's Mastering Python
book

Daniel Arbuckle's Mastering Python

by Daniel Arbuckle
June 2017
Beginner to intermediate
274 pages
6h 49m
English
Packt Publishing
Content preview from Daniel Arbuckle's Mastering Python

What is a unit test?

First of all, let's find out what is a unit test. A unit test is a single small chunk of test code that tests correct behavior or a single specific flaw within an isolated small chunk of program code.

There are reasons for each part of this definition. A unit test is source code because one of the secrets of unit testing is that we put the maximum amount of the effort of testing on the computer, which is where it should belong.

The test code tells the computer how to perform the test, which allows us to perform the test often and easily. A unit test is small because a large test is almost inevitably testing for more than one thing.

This can be summarized as:

  • Small, simple code
  • Checks a small piece of the program
  • Answers ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Deep Learning for Games

Hands-On Deep Learning for Games

Micheal Lanham
Mastering PyCharm

Mastering PyCharm

Nafiul Islam
Python: Journey from Novice to Expert

Python: Journey from Novice to Expert

Fabrizio Romano, Dusty Phillips, Rick van Hattem

Publisher Resources

ISBN: 9781787283695Supplemental Content