Testing programs concurrently

Another aspect of combining testing and concurrent programming is performing tests in a concurrent way. This aspect of testing is more straightforward and intuitive than testing concurrent programs themselves. In this subsection, we will explore a library that can help us facilitate this process, concurrencytest, which can work seamlessly with test cases implemented with the preceding unittest module.

concurrencytest is designed as a testtools extension that implements concurrency in running test suites. It can be installed from PyPI, using pip, as follows:

pip install concurrencytest

Additionally, concurrencytest is dependent on the testtools (pypi.org/project/testtools/) and python-subunit (pypi.org/project/python-subunit/ ...

Get Mastering Concurrency in Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.