About 172 results
Open links in new tab
  1. unittest — Unit testing framework — Python 3.13.3 documentation

    2 days ago · The basic building blocks of unit testing are test cases — single scenarios that must be set up and checked for correctness. In unittest, test cases are represented by unittest.TestCase instances. To make your own test cases you must write subclasses of TestCase or use FunctionTestCase.

  2. unittest.mock — getting started — Python 3.13.3 documentation

    1 day ago · A common use case is to mock out classes instantiated by your code under test. When you patch a class, then that class is replaced with a mock. Instances are created by calling the class .

  3. 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, designed from the start to use doctest.

  4. test — Regression tests package for Python — Python 3.13.3 …

    2 days ago · The test package can be run as a script to drive Python’s regression test suite, thanks to the -m option: python -m test. Under the hood, it uses test.regrtest ; the call python -m test.regrtest used in previous Python versions still works.

  5. The Python Tutorial — Python 3.13.3 documentation

    1 day ago · The Python interpreter is easily extended with new functions and data types implemented in C or C++ (or other languages callable from C). Python is also suitable as an extension language for customizable applications. This tutorial introduces the reader informally to the basic concepts and features of the Python language and system.

  6. unittest.mock — mock object library — Python 3.13.3 …

    2 days 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. unittest.mock provides a core Mock class removing the need to create a host of stubs throughout your test suite. After performing an action, you can make assertions about ...

  7. 25.3. unittest — 单元测试框架 — Python 2.7.18 文档

    The basic building blocks of unit testing are test cases — single scenarios that must be set up and checked for correctness. In unittest, test cases are represented by instances of unittest ’s TestCase class. To make your own test cases you must write subclasses of TestCase, or use FunctionTestCase.

  8. __main__ — Top-level code environment — Python 3.13.3 …

    23 hours ago · In Python, the special name __main__ is used for two important constructs: the name of the top-level environment of the program, which can be checked using the __name__ == '__main__' expression; and. the __main__.py file in Python packages.

  9. Regular Expression HOWTO — Python 3.14.0a7 documentation

    Apr 23, 2025 · Perform case-insensitive matching; character class and literal strings will match letters by ignoring case. For example, [A-Z] will match lowercase letters, too. Full Unicode matching also works unless the ASCII flag is used to disable non-ASCII matches.

  10. Built-in Types — Python 3.13.3 documentation

    1 day ago · if concatenating str objects, you can build a list and use str.join() at the end or else write to an io.StringIO instance and retrieve its value when complete. if concatenating bytes objects, you can similarly use bytes.join() or io.BytesIO, or you can do in-place concatenation with a bytearray object.

Refresh