Python Module unittest: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 10: Line 10:
<font color=darkkhaki>TODO: https://www.pythonpool.com/python-unittest-vs-pytest/</font>
<font color=darkkhaki>TODO: https://www.pythonpool.com/python-unittest-vs-pytest/</font>
=Concepts=
=Concepts=
==Test Fixture==
A test fixture represents the code needed to prepare the context for running one or more tests (create temporary databases, directories, etc.), and any associated cleanup actions.
==Test Case==
A test case is the individual unit of testing. In unittest, the test cases inherit from the base class <code>[[#TestCase|TestCase]]</code>.
==Test Suite==
A collection of test cases, test suites or both.
==Test Runner==
The test runner is the component that orchestrates the execution of tests and provides the outcomes to the user.


==<tt>unittest.mock</tt>==
==<tt>unittest.mock</tt>==
=API=
==<tt>TestCase</tt>==

Revision as of 02:00, 12 July 2022

External

Internal

Overview

unittest vs. pytest

TODO: https://www.pythonpool.com/python-unittest-vs-pytest/

Concepts

Test Fixture

A test fixture represents the code needed to prepare the context for running one or more tests (create temporary databases, directories, etc.), and any associated cleanup actions.

Test Case

A test case is the individual unit of testing. In unittest, the test cases inherit from the base class TestCase.

Test Suite

A collection of test cases, test suites or both.

Test Runner

The test runner is the component that orchestrates the execution of tests and provides the outcomes to the user.

unittest.mock

API

TestCase