_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)
unittest.TestCase.debug() raises now a SkipTest if the class or
the test method are decorated with the skipping decorator.
Previously it only raised a SkipTest if the test method was decorated
with other decorator in addition to the skipping decorator, or
if SkipTest was explicitly raised in the test or setup methods.
(cherry picked from commit dea59cf88a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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>
- Add link to str object and sqlite3 transaction control
- Mention that exceptions are not propagated
(cherry picked from commit 51056b40e7)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
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>
The line that should not have been needed on macOS tk 8.6.8 but was,
should not be a problem on Ubuntu, but is. It is not needed on macOS
tk 8.6.11, installed with 3.10. Disable it but leave it for
now in case some system needs it.
(cherry picked from commit 1afc7b3219)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 1aaa859497)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Fixes infinite loop on unittest.mock.seal() of mocks created by
unittest.create_autospec().
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
(cherry picked from commit 7f60c9e1c6)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
importlib.find_loader should also be slated for 3.12 like the others in GH-25169 and as documented in https://docs.python.org/3.11/whatsnew/3.10.htmlGH-deprecated.
(cherry picked from commit 9f93018b69)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* 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>
It is a decorator factory and should be always followed by "()".
(cherry picked from commit 9260e67398)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>