
unittest — Unit testing framework — Python 3.13.3 documentation
2 days ago · The unittest unit testing framework was originally inspired by JUnit and has a similar flavor as major unit testing frameworks in other languages. It supports test automation, sharing …
unittest.mock — getting started — Python 3.13.3 documentation
3 days ago · >>> class MyTest(unittest.TestCase): ... @patch.object(SomeClass, 'attribute', sentinel.attribute) ... def test_something(self): ... self.assertEqual(SomeClass.attribute, …
doctest — Test interactive Python examples — Python 3.13.3 …
2 days ago · Write text files containing test cases as interactive examples, and test the files using testfile() or DocFileSuite(). This is recommended, although is easiest to do for new projects, …
test — Regression tests package for Python — Python 3.13.3 …
2 days ago · Each module in the test package whose name starts with test_ is a testing suite for a specific module or feature. All new tests should be written using the unittest or doctest module. …
unittest.mock — mock object library — Python 3.13.3 …
1 day ago · unittest.mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used. …
timeit — Measure execution time of small code snippets - Python
2 days ago · This module provides a simple way to time small bits of Python code. It has both a Command-Line Interface as well as a callable one. It avoids a number of common traps for …
Enum HOWTO — Python 3.13.3 documentation
2 days ago · Unlike many languages that treat enumerations solely as name/value pairs, Python Enums can have behavior added. For example, datetime.date has two methods for returning …
7. Input and Output — Python 3.13.3 documentation
1 day ago · This chapter will discuss some of the possibilities. 7.1. Fancier Output Formatting ¶ So far we’ve encountered two ways of writing values: expression statements and the print() …
25.3. unittest — 单元测试框架 — Python 2.7.18 文档
This class implements the interface needed by the test runner to allow it to drive the test, and methods that the test code can use to check for and report various kinds of failure.
3.13.3 Documentation - Python
4 days ago · The official Python documentation.