Book Image

Daniel Arbuckle's Mastering Python

By : Daniel Arbuckle
Book Image

Daniel Arbuckle's Mastering Python

By: Daniel Arbuckle

Overview of this book

Daniel Arbuckle's Mastering Python covers the basics of operating in a Python development environment, before moving on to more advanced topics. Daniel presents you with real-world solutions to Python 3.6 and advanced-level concepts, such as reactive programming, microservices, ctypes, and Cython tools. You don't need to be familiar with the Python language to use this book, as Daniel starts with a Python primer. Throughout, Daniel highlights the major aspects of managing your Python development environment, shows you how to handle parallel computation, and helps you to master asynchronous I/O with Python 3.6 to improve performance. Finally, Daniel will teach you the secrets of metaprogramming and unit testing in Python, helping you acquire the perfect skillset to be a Python expert. Daniel will get you up to speed on everything from basic programming practices to high-end tools and techniques, things that will help set you apart as a successful Python programmer.
Table of Contents (13 chapters)

Using unittest's test discovery

In this section, we'll take a look at the unittest package's ability to run many tests at once with a single command.

We've seen how to easily run all the tests in a particular file, but for a large project, putting all the tests into a single file would be troublesome. They need to be separated into different files according to logical groupings, or the test suite will become unmanageable. On the other hand, it would be a pain to have to manually tell unittests to run the test and a whole bunch of files if we were to test or list out each file.

Fortunately, there's a way to split our test suites into many files and still run them with a simple command, as shown in the following code:

We use a unit testing tool that supports test discovery. This basically just means it looks at the available files and decides for itself...