cpython/Lib/test/support
Victor Stinner 13a00078b8
gh-108634: Py_TRACE_REFS uses a hash table (#108663)
Python built with "configure --with-trace-refs" (tracing references)
is now ABI compatible with Python release build and debug build.
Moreover, it now also supports the Limited API.

Change Py_TRACE_REFS build:

* Remove _PyObject_EXTRA_INIT macro.
* The PyObject structure no longer has two extra members (_ob_prev
  and _ob_next).
* Use a hash table (_Py_hashtable_t) to trace references (all
  objects): PyInterpreterState.object_state.refchain.
* Py_TRACE_REFS build is now ABI compatible with release build and
  debug build.
* Limited C API extensions can now be built with Py_TRACE_REFS:
  xxlimited, xxlimited_35, _testclinic_limited.
* No longer rename PyModule_Create2() and PyModule_FromDefAndSpec2()
  functions to PyModule_Create2TraceRefs() and
  PyModule_FromDefAndSpec2TraceRefs().
* _Py_PrintReferenceAddresses() is now called before
  finalize_interp_delete() which deletes the refchain hash table.
* test_tracemalloc find_trace() now also filters by size to ignore
  the memory allocated by _PyRefchain_Trace().

Test changes for Py_TRACE_REFS:

* Add test.support.Py_TRACE_REFS constant.
* Add test_sys.test_getobjects() to test sys.getobjects() function.
* test_exceptions skips test_recursion_normalizing_with_no_memory()
  and test_memory_error_in_PyErr_PrintEx() if Python is built with
  Py_TRACE_REFS.
* test_repl skips test_no_memory().
* test_capi skisp test_set_nomemory().
2023-08-31 18:33:34 +02:00
..
_hypothesis_stubs GH-86275: Implementation of hypothesis stubs for property-based tests, with zoneinfo tests (#22863) 2023-05-12 08:35:53 -04:00
__init__.py gh-108634: Py_TRACE_REFS uses a hash table (#108663) 2023-08-31 18:33:34 +02:00
ast_helper.py gh-100518: Add tests for `ast.NodeTransformer` (#100521) 2023-01-21 21:44:41 +00:00
asynchat.py gh-72719: Remove asyncore and asynchat modules (#96580) 2022-11-08 16:48:58 +01:00
asyncore.py gh-102799: use sys.exception() instead of sys.exc_info() in tests (#103293) 2023-04-06 11:08:25 +01:00
bytecode_helper.py gh-104615: don't make unsafe swaps in apply_static_swaps (#104620) 2023-05-18 21:22:03 +00:00
hashlib_helper.py bpo-45042: Now test classes decorated with `requires_hashdigest` are not skipped (GH-28060) 2021-09-04 23:42:36 +03:00
hypothesis_helper.py gh-86275: improve Hypothesis configuration for CI and local runs (#104468) 2023-05-21 05:52:29 -06:00
import_helper.py gh-104310: Add importlib.util.allowing_all_extensions() (gh-104311) 2023-05-08 16:56:01 -06:00
interpreters.py Update test.support.interpreters to include missing RunFailedError import (#103841) 2023-06-26 17:30:20 +02:00
logging_helper.py bpo-40275: Avoid importing logging in test.support (GH-19601) 2020-04-25 11:35:18 +03:00
os_helper.py gh-100809: Fix handling of drive-relative paths in pathlib.Path.absolute() (GH-100812) 2023-02-17 14:08:14 +00:00
script_helper.py bpo-40280: Skip subprocess-based tests on wasm32-emscripten (GH-30615) 2022-01-25 08:09:06 +01:00
socket_helper.py gh-104773: PEP 594: Remove the nntplib module (#104894) 2023-05-24 21:15:43 +00:00
testcase.py gh-103791: Make contextlib.suppress also act on exceptions within an ExceptionGroup (#103792) 2023-04-24 22:17:02 +00:00
testresult.py GH-103857: Deprecate utcnow and utcfromtimestamp (#103858) 2023-04-27 11:32:30 -06:00
threading_helper.py gh-104812: Run Pending Calls in any Thread (gh-104813) 2023-06-13 15:02:19 -06:00
warnings_helper.py gh-103109: Document ignore_warnings() test support helper (#103110) 2023-04-03 00:18:25 +02:00