List of main unit test frameworks¶
Estimated time to read: 2 minutes
Framework | License | Category | Features |
---|---|---|---|
unittest | Free software (MIT License) | Unit Testing | Part of Python standard library. |
PyTest | Free software (MIT License) | Unit Testing | Stand alone, allows compact test suites. |
Nose2 | Free software (BSD License) | unittest ext | Carries unittest features with additional feature and plugins. |
Testify | Free software (ASF License) | unittest ext | Carries unittest and nose features with additional feature and plugins. |
Unittest¶
Unittest is the very first Python-based automated unit test framework that was designed to work with the Python standard library. Supports the reuse of test suits and test organization. It was inspired by JUnit and supports test automation including test collections, test independence, setup code for tests, etc. It is also being called as PyUnit. Unittest2 is a backport of additional new features added to the Unittest.
Pytest¶
PyTest is an open-source Python-based testing framework that is generally all-purpose but especially for Functional and API testing. Pip (Package Installer for Python) is required for PyTest installation. It supports simple or complex text code to test API, databases, and UIs. Simple syntax is helpful for easy test execution. Rich plugins and is able to run tests in parallel. Can run any specific subset of tests.
Nose2¶
Nose2 is the successor of Nose and it is a Python-based Unit Testing framework that can run Doctests and UnitTests. Nose2 is based on unittest hence it is referred to as extend unittest or unittest with the plugin that was designed to make testing simple and easier. Nose uses collective tests from unittest.testcase and supports multiple functions for writing tests and exceptions. Nose supports package fixtures, classes, modules, and complex initialization to be defined at a single time instead of writing frequently.
Testity¶
Testify was designed to replace unittest and nose. Testify has more advanced features over unittest. Testify is popular as a Java implementation of semantic testing (Easy to learn and implementing software testing specification). Performing Automated unit, Integration and System Testing is easier to Testify.
Source: https://www.softwaretestinghelp.com/python-testing-frameworks/