cpython/Lib/test
Jelle Zijlstra 2e0d445364
gh-119180: Fix annotationlib.ForwardRef.evaluate with no globals (#124326)
We were sometimes passing None as the globals argument to eval(), which makes it
inherit the globals from the calling scope. Instead, ensure that globals is always
non-None. The test was passing accidentally because I passed "annotationlib" as a
module object; fix that. Also document the parameters to ForwardRef() and remove
two unused private ones.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-09-23 19:06:19 +00:00
..
archivetestdata
audiodata
certdata
cjkencodings
configdata
crashers
data
decimaltestdata Fix typos (#123775) 2024-09-09 14:58:26 +02:00
dtracedata
encoded_modules
leakers
libregrtest Fix typos (#123775) 2024-09-09 14:58:26 +02:00
mathdata Fix typos (#123775) 2024-09-09 14:58:26 +02:00
regrtestdata/import_from_tests
subprocessdata
support gh-124213: Skip tests failing inside systemd-nspawn --suppress-sync=true (#124215) 2024-09-20 13:37:49 +00:00
test_ast gh-116022: Improve `repr()` of AST nodes (#117046) 2024-09-18 10:28:22 -07:00
test_asyncio gh-122957: Fix test flakiness in asyncio test in free-thread build (#124039) 2024-09-13 11:13:30 -07:00
test_capi gh-119771: Set errno on overflows in _Py_c_pow() (#120256) 2024-09-18 10:39:11 +02:00
test_cext test_cext, test_cppext: enable /W4 warnings on Windows (#124253) 2024-09-19 22:32:01 +02:00
test_concurrent_futures Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_cppext test_cext, test_cppext: enable /W4 warnings on Windows (#124253) 2024-09-19 22:32:01 +02:00
test_ctypes
test_dataclasses gh-123935: Fix typo in `_get_slots` in `dataclasses.py` (#123941) 2024-09-12 10:29:06 +03:00
test_doctest gh-117482: Simplify the Fix For Builtin Types Slot Wrappers (GH-122865) 2024-09-09 16:04:58 +02:00
test_email
test_free_threading Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_future_stmt
test_gdb
test_import gh-123880: Allow recursive import of single-phase-init modules (GH-123950) 2024-09-20 10:27:34 +02:00
test_importlib gh-123085: _compile_importlib: Avoid copying sources before compilation (GH-124131) 2024-09-18 14:14:34 +02:00
test_inspect
test_interpreters
test_json
test_module
test_multiprocessing_fork
test_multiprocessing_forkserver
test_multiprocessing_spawn
test_pathlib
test_peg_generator
test_pydoc
test_pyrepl
test_sqlite3
test_tkinter
test_tomllib
test_tools
test_ttk
test_unittest gh-123934: Fix `MagicMock` not to reset magic method return values (#124038) 2024-09-19 10:55:47 +03:00
test_warnings
test_zipfile Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_zoneinfo
tkinterdata
tokenizedata
tracedmodules
typinganndata
wheeldata
xmltestdata
zipimport_data
.ruff.toml
__init__.py
__main__.py
_test_atexit.py
_test_eintr.py
_test_embed_set_config.py
_test_embed_structseq.py gh-108303: Remove the non-test `Lib/test/reperf.py` (GH-114356) 2024-09-13 13:13:52 +02:00
_test_monitoring_shutdown.py
_test_multiprocessing.py
_test_venv_multiprocessing.py
archiver_tests.py
audiotests.py
audit-tests.py
autotest.py
bisect_cmd.py
clinic.test.c
cov.py
curses_tests.py
datetimetester.py
dis_module.py
empty.vbs
exception_hierarchy.txt
fork_wait.py
levenshtein_examples.json
list_tests.py
lock_tests.py
mapping_tests.py
memory_watchdog.py
mime.types
mock_socket.py
mp_fork_bomb.py
mp_preload.py
multibytecodec_support.py
pickletester.py gh-77894: Fix a crash when the GC breaks a loop containing a memoryview (GH-123898) 2024-09-11 12:05:46 +03:00
profilee.py
pstats.pck
pyclbr_input.py
pythoninfo.py
randv2_32.pck
randv2_64.pck
randv3.pck
re_tests.py
regrtest.py
relimport.py
seq_tests.py
signalinterproctester.py
ssl_servers.py
ssltests.py
string_tests.py closes gh-124016: update Unicode to 16.0.0 (#124017) 2024-09-13 07:47:04 -07:00
test___all__.py
test__colorize.py
test__interpchannels.py
test__interpreters.py
test__locale.py
test__opcode.py
test__osx_support.py
test_abc.py
test_abstract_numbers.py
test_android.py gh-116622: Mock the passage of time in Android logcat rate limit tests (#124015) 2024-09-13 04:58:11 +00:00
test_annotationlib.py gh-119180: Fix annotationlib.ForwardRef.evaluate with no globals (#124326) 2024-09-23 19:06:19 +00:00
test_argparse.py GH-124321: Fix argparse negative number parsing to capture -.5(GH-124322) 2024-09-23 11:16:55 -07:00
test_array.py
test_asdl_parser.py
test_asyncgen.py
test_atexit.py
test_audit.py
test_augassign.py
test_base64.py
test_baseexception.py
test_bdb.py
test_bigaddrspace.py
test_bigmem.py
test_binascii.py
test_binop.py
test_bisect.py
test_bool.py
test_buffer.py
test_bufio.py
test_builtin.py
test_bytes.py
test_bz2.py
test_c_locale_coercion.py
test_calendar.py
test_call.py
test_charmapcodec.py
test_class.py Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_clinic.py
test_cmath.py
test_cmd.py
test_cmd_line.py
test_cmd_line_script.py
test_code.py
test_code_module.py
test_codeccallbacks.py
test_codecencodings_cn.py
test_codecencodings_hk.py
test_codecencodings_iso2022.py
test_codecencodings_jp.py
test_codecencodings_kr.py
test_codecencodings_tw.py
test_codecmaps_cn.py
test_codecmaps_hk.py
test_codecmaps_jp.py
test_codecmaps_kr.py
test_codecmaps_tw.py
test_codecs.py
test_codeop.py
test_collections.py
test_colorsys.py
test_compare.py
test_compile.py gh-124022: Fix bug where class docstring is removed in interactive mode (#124023) 2024-09-13 14:06:06 +00:00
test_compileall.py
test_compiler_assemble.py
test_compiler_codegen.py
test_complex.py
test_configparser.py
test_contains.py
test_context.py
test_contextlib.py
test_contextlib_async.py
test_copy.py
test_copyreg.py
test_coroutines.py
test_cprofile.py
test_csv.py
test_curses.py
test_datetime.py
test_dbm.py
test_dbm_dumb.py
test_dbm_gnu.py
test_dbm_ndbm.py
test_dbm_sqlite3.py
test_decimal.py gh-123811: Test that round(Decimal) can return signed zero (GH-124007) 2024-09-13 15:49:13 +03:00
test_decorators.py
test_defaultdict.py
test_deque.py
test_descr.py
test_descrtut.py
test_devpoll.py
test_dict.py
test_dict_version.py
test_dictcomps.py
test_dictviews.py
test_difflib.py
test_difflib_expect.html
test_dis.py
test_docxmlrpc.py
test_dtrace.py
test_dynamic.py
test_dynamicclassattribute.py
test_eintr.py
test_embed.py gh-108303: Remove the non-test `Lib/test/reperf.py` (GH-114356) 2024-09-13 13:13:52 +02:00
test_ensurepip.py
test_enum.py Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_enumerate.py
test_eof.py
test_epoll.py
test_errno.py
test_except_star.py
test_exception_group.py
test_exception_hierarchy.py
test_exception_variations.py
test_exceptions.py
test_extcall.py
test_external_inspection.py
test_faulthandler.py
test_fcntl.py
test_file.py
test_file_eintr.py
test_filecmp.py
test_fileinput.py
test_fileio.py
test_fileutils.py
test_finalization.py
test_float.py gh-123811: test that round() can return signed zero (#123829) 2024-09-11 11:21:05 +02:00
test_flufl.py
test_fnmatch.py
test_fork1.py
test_format.py
test_fractions.py Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_frame.py
test_frozen.py
test_fstring.py Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_ftplib.py
test_funcattrs.py
test_functools.py
test_gc.py
test_generated_cases.py GH-123996: Explicitly mark 'self_or_null' as an array of size 1 to ensure that it is kept in memory for calls (GH-124003) 2024-09-12 15:32:45 +01:00
test_generator_stop.py
test_generators.py gh-123923: Defer refcounting for `f_executable` in `_PyInterpreterFrame` (#123924) 2024-09-12 12:37:06 -04:00
test_genericalias.py
test_genericclass.py
test_genericpath.py
test_genexps.py
test_getopt.py
test_getpass.py
test_getpath.py Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_gettext.py
test_glob.py
test_global.py
test_grammar.py
test_graphlib.py
test_grp.py
test_gzip.py
test_hash.py
test_hashlib.py
test_heapq.py
test_hmac.py
test_html.py
test_htmlparser.py
test_http_cookiejar.py
test_http_cookies.py
test_httplib.py
test_httpservers.py
test_idle.py
test_imaplib.py
test_index.py
test_int.py
test_int_literal.py
test_io.py
test_ioctl.py
test_ipaddress.py gh-124217, ipaddress: Add RFC 9637 reserved IPv6 block `3fff::/20` (#124240) 2024-09-20 11:01:28 +00:00
test_isinstance.py
test_iter.py
test_iterlen.py
test_itertools.py Small improvements to the itertools docs (GH-123885) 2024-09-09 20:57:49 -05:00
test_keyword.py
test_keywordonlyarg.py
test_kqueue.py
test_largefile.py
test_launcher.py
test_linecache.py
test_list.py
test_listcomps.py
test_lltrace.py
test_locale.py GH-124108: Skip test_locale.test_strcoll_with_diacritic() on NetBSD (#124110) 2024-09-16 23:00:36 +00:00
test_logging.py Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_long.py
test_longexp.py
test_lzma.py
test_mailbox.py
test_marshal.py
test_math.py gh-124040: Adjust few tests in testHypot/testDist to get exactly computed results (GH-124042) 2024-09-19 11:11:03 +03:00
test_math_property.py
test_memoryio.py
test_memoryview.py gh-77894: Fix a crash when the GC breaks a loop containing a memoryview (GH-123898) 2024-09-11 12:05:46 +03:00
test_metaclass.py
test_mimetypes.py
test_minidom.py
test_mmap.py gh-124213: Skip tests failing inside systemd-nspawn --suppress-sync=true (#124215) 2024-09-20 13:37:49 +00:00
test_modulefinder.py
test_monitoring.py
test_msvcrt.py Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_multibytecodec.py
test_multiprocessing_main_handling.py
test_named_expressions.py
test_netrc.py
test_ntpath.py
test_numeric_tower.py
test_opcache.py
test_opcodes.py
test_openpty.py
test_operator.py
test_optimizer.py
test_optparse.py
test_ordered_dict.py
test_os.py gh-124213: Skip tests failing inside systemd-nspawn --suppress-sync=true (#124215) 2024-09-20 13:37:49 +00:00
test_osx_env.py
test_patma.py
test_pdb.py
test_peepholer.py
test_pep646_syntax.py
test_perf_profiler.py test: fix _is_perf_version_at_least typo (#124199) 2024-09-18 13:44:32 +01:00
test_perfmaps.py
test_pickle.py
test_picklebuffer.py
test_pickletools.py
test_pkg.py
test_pkgutil.py
test_platform.py
test_plistlib.py
test_poll.py
test_popen.py
test_poplib.py
test_positional_only_arg.py
test_posix.py gh-123797: Check for runtime availability of `ptsname_r` on macos (#123806) 2024-09-20 09:30:27 +03:00
test_posixpath.py
test_pow.py
test_pprint.py
test_print.py
test_profile.py
test_property.py Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_pstats.py
test_pty.py
test_pulldom.py
test_pwd.py
test_py_compile.py
test_pyclbr.py
test_pyexpat.py
test_queue.py Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_quopri.py
test_raise.py
test_random.py gh-123968: Fix lower bound for `python -m random --float` (#123971) 2024-09-12 16:54:18 +03:00
test_range.py
test_re.py Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_readline.py
test_regrtest.py
test_repl.py
test_reprlib.py
test_resource.py
test_richcmp.py
test_rlcompleter.py
test_robotparser.py
test_runpy.py
test_sax.py
test_sched.py
test_scope.py
test_script_helper.py
test_secrets.py
test_select.py
test_selectors.py
test_set.py
test_setcomps.py
test_shelve.py
test_shlex.py
test_shutil.py
test_signal.py gh-124083: Skip test_signal.test_strsignal() on NetBSD (#124084) 2024-09-18 21:22:00 +00:00
test_site.py
test_slice.py
test_smtplib.py
test_smtpnet.py
test_socket.py Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_socketserver.py
test_sort.py
test_source_encoding.py
test_ssl.py
test_stable_abi_ctypes.py gh-124153: Implement `PyType_GetBaseByToken()` and `Py_tp_token` slot (GH-124163) 2024-09-18 09:18:19 +02:00
test_startfile.py
test_stat.py
test_statistics.py
test_str.py closes gh-124016: update Unicode to 16.0.0 (#124017) 2024-09-13 07:47:04 -07:00
test_strftime.py
test_string.py
test_string_literals.py Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_stringprep.py
test_strptime.py
test_strtod.py
test_struct.py gh-124248: Fix crash in struct when processing 0p fields (#124251) 2024-09-20 12:08:59 +02:00
test_structseq.py
test_subclassinit.py
test_subprocess.py
test_sundry.py
test_super.py
test_support.py
test_symtable.py
test_syntax.py
test_sys.py gh-124153: Implement `PyType_GetBaseByToken()` and `Py_tp_token` slot (GH-124163) 2024-09-18 09:18:19 +02:00
test_sys_setprofile.py
test_sys_settrace.py
test_sysconfig.py
test_syslog.py
test_tabnanny.py
test_tarfile.py
test_tcl.py
test_tempfile.py
test_termios.py gh-124030: Skip test_tcsendbreak on NetBSD for ENOTTY error (GH-124031) 2024-09-13 19:27:54 +03:00
test_textwrap.py
test_thread.py
test_threadedtempfile.py
test_threading.py
test_threading_local.py
test_threadsignals.py
test_time.py
test_timeit.py
test_timeout.py
test_tokenize.py
test_trace.py
test_traceback.py gh-122145: Handle an empty AST body when reporting tracebacks (#122161) 2024-09-18 18:42:33 +02:00
test_tracemalloc.py
test_ttk_textonly.py
test_tty.py
test_tuple.py
test_turtle.py gh-123614: Add save function to turtle.py (#123617) 2024-09-12 21:36:17 -07:00
test_type_aliases.py
test_type_annotations.py
test_type_cache.py
test_type_comments.py
test_type_params.py gh-123881: Add additional test coverage for PEP 695 edge cases (#123886) 2024-09-10 08:26:42 +01:00
test_typechecks.py
test_types.py gh-117482: Simplify the Fix For Builtin Types Slot Wrappers (GH-122865) 2024-09-09 16:04:58 +02:00
test_typing.py gh-124206: Fix calling get_annotate_function() on static types (#124208) 2024-09-18 08:39:22 -07:00
test_ucn.py
test_unary.py
test_unicode_file.py
test_unicode_file_functions.py
test_unicode_identifiers.py
test_unicodedata.py closes gh-124016: update Unicode to 16.0.0 (#124017) 2024-09-13 07:47:04 -07:00
test_univnewlines.py
test_unpack.py gh-122239: Add actual count in unbalanced unpacking error message when possible (#122244) 2024-09-10 16:07:30 +01:00
test_unpack_ex.py
test_unparse.py
test_urllib.py
test_urllib2.py
test_urllib2_localnet.py
test_urllib2net.py
test_urllib_response.py
test_urllibnet.py
test_urlparse.py
test_userdict.py
test_userlist.py
test_userstring.py
test_utf8_mode.py
test_utf8source.py
test_uuid.py
test_venv.py gh-124212: Fix undefined variable in error message in venv (GH-124211) 2024-09-18 22:05:18 +00:00
test_wait3.py
test_wait4.py
test_wave.py
test_weakref.py
test_weakset.py
test_webbrowser.py
test_winapi.py
test_winconsoleio.py
test_winreg.py
test_winsound.py
test_with.py
test_wmi.py
test_wsgiref.py
test_xml_dom_minicompat.py
test_xml_etree.py
test_xml_etree_c.py
test_xmlrpc.py
test_xxlimited.py
test_xxtestfuzz.py
test_yield_from.py
test_zipapp.py
test_zipfile64.py
test_zipimport.py Fix typos (#123775) 2024-09-09 14:58:26 +02:00
test_zipimport_support.py
test_zlib.py
testcodec.py
tf_inherit_check.py
win_console_handler.py
xmltests.py