Staging: this is not the live site, pydocs.org.
test.support Symbols in test.support a adjust_int_max_str_digits This function returns a context manager that will change the global sys.set_int_max_str_digits() setting for the duration of the context to allow execution of test code that needs a different limit o… b busy_retry Run the loop body until break stops the loop. c calcobjsize Return the size of the PyObject whose structure members are defined by fmt. calcvobjsize Return the size of the PyVarObject whose structure members are defined by fmt. captured_stderr A context managers that temporarily replaces the named stream with io.StringIO object. captured_stdin A context managers that temporarily replaces the named stream with io.StringIO object. captured_stdout A context managers that temporarily replaces the named stream with io.StringIO object. check__all__ Assert that the __all__ variable of module contains all public names. check_impl_detail Use this check to guard CPython’s implementation-specific tests or to run them only on the implementations guarded by the arguments. checksizeof For testcase test, assert that the sys.getsizeof for o plus the GC header size equals size. d detect_api_mismatch Returns the set of attributes, functions or methods of ref_api not found on other_api, except for a defined list of items to be ignored in this check specified in ignore. disable_gc A context manager that disables the garbage collector on entry. f findfile Return the path to the file named filename. g gc_collect Force as many objects as possible to be collected. get_attribute Get an attribute, raising unittest.SkipTest if AttributeError is raised. get_original_stdout Return the original stdout set by record_original_stdout() or sys.stdout if it’s not set. i impl_detail Decorator for invoking check_impl_detail() on guards. is_apple True if sys.platform is darwin or is_apple_mobile is True. is_jython True if the running interpreter is Jython. is_wasi True if sys.platform is wasi. isolation.runInSubprocess Decorator that runs the decorated test in a fresh interpreter subprocess, in isolation, so that it does not share global or interpreter state with the rest of the test run. isolation.runningInSubprocess True while the code runs in the isolated subprocess spawned by runInSubprocess(), and False otherwise (including in the parent process and in a normal, non-isolated test run). l LARGEST Object that is greater than anything (except itself). linked_to_musl Return False if there is no evidence the interpreter was compiled with musl, otherwise return a version triple, either (0, 0, 0) if the version is unknown, or the actual version if it is known. load_package_tests Generic implementation of the unittest load_tests protocol for use in test packages. LOOPBACK_TIMEOUT Timeout in seconds for tests using a network server listening on the network local loopback interface like 127.0.0.1. m max_memuse Set by set_memlimit() as the memory limit for big memory tests. MISSING_C_DOCSTRINGS Set to True if Python is built without docstrings (the WITH_DOC_STRINGS macro is not defined). missing_compiler_executable Check for the existence of the compiler executables whose names are listed in cmd_names or all the compiler executables when cmd_names is empty and return the first missing executable or None when no… n NEVER_EQ Object that is not equal to anything (even to ALWAYS_EQ). no_tracing Decorator to temporarily turn off tracing for the duration of the test. p patch Override object_to_patch.attr_name with new_value. PGO Set when tests can be skipped when they are not useful for PGO. PIPE_MAX_SIZE A constant that is likely larger than the underlying OS pipe buffer size, to make writes blocking. Py_DEBUG True if Python was built with the Py_DEBUG macro defined, that is, if Python was built in debug mode. r real_max_memuse Set by set_memlimit() as the memory limit for big memory tests. reap_children Call this from setUp(), tearDown(), or tearDownModule() in tests that start subprocesses. refcount_test Decorator for tests which involve reference counting. requires Raise ResourceDenied if resource is not available. requires_bz2 Decorator for skipping tests if bz2 doesn’t exist. run_with_locale A decorator for running a function in a different locale, correctly resetting it after it has finished. run_with_tz A decorator for running a function in a specific timezone, correctly resetting it after it has finished. s SaveSignals Class to save and restore signal handlers registered by the Python signal handler. set_memlimit Set the values for max_memuse and real_max_memuse for big memory tests. SHORT_TIMEOUT Timeout in seconds to mark a test as failed if the test takes “too long”. SMALLEST Object that is less than anything (except itself). SOCK_MAX_SIZE A constant that is likely larger than the underlying OS socket buffer size, to make writes blocking. sortdict Return a repr of dict with keys sorted. SuppressCrashReport A context manager used to try to prevent crash dialog popups on tests that are expected to crash a subprocess. swap_attr Context manager to swap out an attribute with a new object. swap_item Context manager to swap out an item with a new object. t TEST_HOME_DIR Set to the top level directory for the test package. TEST_HTTP_URL Define the URL of a dedicated HTTP server for the network tests. TestFailed Exception to be raised when a test fails. u unix_shell Path for shell if not on Windows; otherwise None. v verbose True when verbose output is enabled. w wait_process Wait until process pid completes and check that the process exit code is exitcode. with_pymalloc Return True if Python was built with pymalloc enabled and is not a free-threaded build.
Python docs © Python Software Foundation · Examples CC0 ·
Source on GitHub · Not affiliated with the PSF