cpython/Lib/test/test_free_threading
Neil Schemenauer d687900f98
gh-128384: Use a context variable for warnings.catch_warnings (gh-130010)
Make `warnings.catch_warnings()` use a context variable for holding
the warning filtering state if the `sys.flags.context_aware_warnings`
flag is set to true.  This makes using the context manager thread-safe in
multi-threaded programs.

Add the `sys.flags.thread_inherit_context` flag.  If true, starting a new
thread with `threading.Thread` will use a copy of the context
from the caller of `Thread.start()`.

Both these flags are set to true by default for the free-threaded build
and false for the default build.

Move the Python implementation of warnings.py into _py_warnings.py.

Make _contextvars a builtin module.

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-04-09 16:18:54 -07:00
..
__init__.py
test_code.py
test_dict.py gh-123358: Use _PyStackRef in LOAD_DEREF (gh-130064) 2025-03-26 12:08:20 -04:00
test_enumerate.py gh-121464: Make concurrent iteration over enumerate safe under free-threading (#125734) 2025-03-14 00:14:05 +05:30
test_func_annotations.py gh-123358: Use _PyStackRef in LOAD_DEREF (gh-130064) 2025-03-26 12:08:20 -04:00
test_gc.py gh-123358: Use _PyStackRef in LOAD_DEREF (gh-130064) 2025-03-26 12:08:20 -04:00
test_iteration.py
test_itertools_batched.py gh-131152: Remove unused imports from tests (part 2) (#131154) 2025-03-13 10:57:40 +01:00
test_list.py gh-123358: Use _PyStackRef in LOAD_DEREF (gh-130064) 2025-03-26 12:08:20 -04:00
test_methodcaller.py gh-131152: Remove unused imports from tests (part 2) (#131154) 2025-03-13 10:57:40 +01:00
test_monitoring.py gh-123358: Use _PyStackRef in LOAD_DEREF (gh-130064) 2025-03-26 12:08:20 -04:00
test_races.py gh-128384: Use a context variable for warnings.catch_warnings (gh-130010) 2025-04-09 16:18:54 -07:00
test_reversed.py gh-120608: Make reversed iterator work with free-threading (#120971) 2025-03-12 12:39:52 +01:00
test_set.py
test_slots.py
test_str.py
test_tokenize.py
test_type.py gh-123358: Use _PyStackRef in LOAD_DEREF (gh-130064) 2025-03-26 12:08:20 -04:00
test_zip.py