Add a PID to names of POSIX shared memory objects to allow
running multiprocessing tests (test_multiprocessing_fork,
test_multiprocessing_spawn, etc) in parallel.
(cherry picked from commit eb4495e8e2)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Work correctly if an additional fresh module imports other
additional fresh module which imports a blocked module.
* Raises ImportError if the specified module cannot be imported
while all additional fresh modules are successfully imported.
* Support blocking packages.
* Always restore the import state of fresh and blocked modules
and their submodules.
* Fix test_decimal and test_xml_etree which depended on an undesired
side effect of import_fresh_module().
(cherry picked from commit ec4d917a6a)
* during tarfile parsing, a zlib error indicates invalid data
* tarfile.open now raises a descriptive exception from the zlib error
* this makes it clear to the user that they may be trying to open a
corrupted tar file
(cherry picked from commit b6fe857250)
Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
Fix the threading._shutdown() function when the threading module was
imported first from a thread different than the main thread: no
longer log an error at Python exit.
(cherry picked from commit 95d3137082)
Co-authored-by: Victor Stinner <vstinner@python.org>
_global_shutdown_lock should be reinitialized in forked children
(cherry picked from commit 0bfa1106ac)
Co-authored-by: nullptr <3621629+0x0L@users.noreply.github.com>
Automerge-Triggered-By: GH:gpshead
Calling Py_InitializeFromConfig()+Py_RunMain() multiple times must
not crash.
Cleanup also test_get_argc_argv().
(cherry picked from commit 5e2c32e08e)
Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit fcbf9b176b)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Instead of explicitly enumerate test classes for run_unittest()
use the unittest ability to discover tests. This also makes these
tests discoverable and runnable with unittest.
load_tests() can be used for dynamic generating tests and adding
doctests. setUpModule(), tearDownModule() and addModuleCleanup()
can be used for running code before and after all module tests.
(cherry picked from commit 40348acc18)
This can occur when the zip file gets deleted, you call zipimport.zipimporter.invalidate_cache(), and then try to use zipimport.zipimporter.find_spec() (i.e. you left the zip file path on sys.path).
(cherry picked from commit 209b7035f7)
Co-authored-by: Brett Cannon <brett@python.org>
Previously, test classes ISOTPTest, J1939Test, BasicUDPLITETest and
UDPLITETimeoutTest were not included in the list of tests and
were not run by regrtest.
(cherry picked from commit 0361335b80)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
tearDown() is not called if setUp() raises an exception
(including SkipTest). addCleanup() should be used for guaranteed
execution of the cleanup code.
(cherry picked from commit 7dacb70485)
Make test_compileall quiet: test_year_2038_mtime_compilation() and
test_larger_than_32_bit_times() of test_compileall no longer log
"Compiling ..." messages to stdout.
(cherry picked from commit cc057ff522)
Co-authored-by: Victor Stinner <vstinner@python.org>
test_gdb.test_pycfunction() now ignores gdb stderr, it no longer logs
messages like:
Function "meth_varargs" not defined.
(cherry picked from commit 84a6061e29)
Co-authored-by: Victor Stinner <vstinner@python.org>
test_pdb.test_checkline_is_not_executable() no longer writes output
to stdout.
Remove also unused variables 'f'.
(cherry picked from commit e08e491a6c)
Co-authored-by: Victor Stinner <vstinner@python.org>
Fix test_readline.test_nonascii(): sometimes, the newline character
is not written at the end, so don't expect it in the output.
(cherry picked from commit 797c8eb9ef)
Co-authored-by: Victor Stinner <vstinner@python.org>
* Calling guess_all_extensions() with strict=False potentially
mutated types_map_inv.
* Mutating the result of guess_all_extensions() mutated types_map_inv.
(cherry picked from commit 97ea18eced)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Update test_sysconfig.test_user_similar() for the posix_user scheme:
"platlib" doesn't use sys.platlibdir.
(cherry picked from commit 49acac00c0)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
(cherry picked from commit b4b6342848)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* Use a private version of _PyType_GetQualName
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Fix regrtest second summary when using -w/--verbose2 command line
option: lists re-run tests in the second test summary.
(cherry picked from commit c4ea45d7d2)
Co-authored-by: Victor Stinner <vstinner@python.org>
It happened with fast range iterator when the calculated stop = start + step * len
was out of the C long range.
(cherry picked from commit 936f6a16b9)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>