summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* bpo-37261: Fix support.catch_unraisable_exception() (GH-14052)Victor Stinner2019-06-131-2/+20
| | | | | The __exit__() method of test.support.catch_unraisable_exception context manager now ignores unraisable exception raised when clearing self.unraisable attribute.
* bpo-37210: Fix pure Python pickle when _pickle is unavailable (GH-14016)Victor Stinner2019-06-131-6/+7
| | | | | | | Allow pure Python implementation of pickle to work even when the C _pickle module is unavailable. Fix test_pickle when _pickle is missing: declare PyPicklerHookTests outside "if has_c_implementation:" block.
* tbpo-36402: Fix threading.Thread._stop() (GH-14047)Victor Stinner2019-06-131-0/+24
| | | Remove the _tstate_lock from _shutdown_locks, don't remove None.
* bpo-36402: Fix threading._shutdown() race condition (GH-13948)Victor Stinner2019-06-121-3/+52
| | | | | | | | | | | | | Fix a race condition at Python shutdown when waiting for threads. Wait until the Python thread state of all non-daemon threads get deleted (join all non-daemon threads), rather than just wait until Python threads complete. * Add threading._shutdown_locks: set of Thread._tstate_lock locks of non-daemon threads used by _shutdown() to wait until all Python thread states get deleted. See Thread._set_tstate_lock(). * Add also threading._shutdown_locks_lock to protect access to threading._shutdown_locks. * Add test_finalization_shutdown() test.
* bpo-37069: regrtest uses sys.unraisablehook (GH-13759)Victor Stinner2019-06-123-1/+50
| | | | | | | | regrtest now uses sys.unraisablehook() to mark a test as "environment altered" (ENV_CHANGED) if it emits an "unraisable exception". Moreover, regrtest logs a warning in this case. Use "python3 -m test --fail-env-changed" to catch unraisable exceptions in tests.
* bpo-37223, test_io: silence last 'Exception ignored in:' (GH-14029)Victor Stinner2019-06-121-0/+5
| | | | | | Use catch_unraisable_exception() to ignore 'Exception ignored in:' error when the internal BufferedWriter of the BufferedRWPair is destroyed. The C implementation doesn't give access to the internal BufferedWriter, so just ignore the warning instead.
* Make asyncio stream sendfile fail on error (was hang) (GH-14025)Andrew Svetlov2019-06-121-5/+8
|
* bpo-35545: Skip `test_asyncio.test_create_connection_ipv6_scope` on AIX ↵Michael Felt2019-06-121-0/+2
| | | | | | | | | | | (GH-14011) because "getaddrinfo()" behaves different on AIX https://bugs.python.org/issue35545
* bpo-36918: Fix "Exception ignored in" in test_urllib (GH-13996)Victor Stinner2019-06-121-6/+15
| | | | Mock the HTTPConnection.close() method in a few unit tests to avoid logging "Exception ignored in: ..." messages.
* bpo-35766: compile(): rename feature_version parameter (GH-13994)Victor Stinner2019-06-121-2/+3
| | | | | | Rename compile() feature_version parameter to _feature_version and convert it to a keyword-only parameter. Update also test_type_comments to pass feature_version as a tuple.
* Fix test_posix if RWF_HIPRI is defined but not preadv2. (GH-13980)Benjamin Peterson2019-06-111-0/+2
| | | If preadv2 is not available, preadv will raise NotImplementedError.
* closes bpo-33758: Skip test_get_type_hints_modules_forwardref. (GH-13977)Benjamin Peterson2019-06-111-2/+2
| | | This test "works" if things are run in the right order, so it's better to use @skip than @expectedFailure here.
* bpo-37219: Remove erroneous optimization for differencing an empty set ↵Raymond Hettinger2019-06-111-0/+6
| | | | | | (GH-13965)
* bpo-37223: test_io: silence destructor errors (GH-13954)Victor Stinner2019-06-111-0/+10
| | | Implement also MockNonBlockWriterIO.seek() method.
* bpo-37178: Allow a one argument form of math.perm() (GH-13905)Raymond Hettinger2019-06-081-2/+7
|
* bpo-37173: Show passed class in inspect.getfile error (GH-13861)Philipp A2019-06-081-0/+18
| | | | | | | | | | | | | Currently, inspect.getfile(str) will report nonsense: ```pytb >>> inspect.getfile(str) TypeError: <module 'builtins' (built-in)> is a built-in class ``` This fixes that https://bugs.python.org/issue37173
* cross port importlib-metadata PR #76 (#13903)Anthony Sottile2019-06-073-0/+2
| | | https://gitlab.com/python-devs/importlib_metadata/merge_requests/76
* bpo-37150: Throw ValueError if FileType class object was passed in ↵zygocephalus2019-06-071-0/+18
| | | | | | | | | | | | | | add_argument (GH-13805) There is a possibility that someone (like me) accidentally will omit parentheses with `FileType` arguments after `FileType`, and parser will contain wrong file until someone will try to use it. Example: ```python parser = argparse.ArgumentParser() parser.add_argument('-x', type=argparse.FileType) ``` https://bugs.python.org/issue37150
* bpo-37181: Fix test_regrtest failures on Windows arm64 (GH-13872)Paul Monson2019-06-071-2/+6
|
* bpo-37191: Move TestPEP590 from test_capi to test_call (GH-13892)Victor Stinner2019-06-072-115/+123
|
* bpo-37169: Rewrite _PyObject_IsFreed() unit tests (GH-13888)Victor Stinner2019-06-071-14/+15
| | | | | Replace two Python function calls with a single one to ensure that no memory allocation is done between the invalid object is created and when _PyObject_IsFreed() is called.
* bpo-37151: simplify classmethoddescr_call (GH-13340)Jeroen Demeyer2019-06-071-2/+2
|
* bpo-36520: Email header folded incorrectly (#13608)websurfer52019-06-061-0/+131
| | | | | | | | | | | | | | | | | * bpo-36520: reset the encoded word offset when starting a new line during an email header folding operation * 📜🤖 Added by blurb_it. * bpo-36520: add an additional test case, and provide descriptive comments for the test_folding_with_utf8_encoding_* tests * bpo-36520: fix whitespace issue * bpo-36520: changes per reviewer request -- remove extraneous backslashes; add whitespace between terminating quotes and line-continuation backslashes; use "bpo-" instead of "issue #" in comments
* bpo-2661: Make mapping tests better usable for custom mapping classes. ↵Walter Dörwald2019-06-061-3/+5
| | | | | | | | | | | | | | | (GH-11157) In test_fromkeys() the derived test class now supports all arguments in its constructor so that the class to be tested can use its own constructor in its fromkeys() implementation. In test_mutatingiteration() the test fails as soon as iterating over a dictionary with one entry and adding new entries in the loop iterates more than once (to avoid endless loops in faulty implementations). https://bugs.python.org/issue2661
* bpo-21315: Fix parsing of encoded words with missing leading ws. (#13425)Abhilash Raj2019-06-052-3/+24
| | | | | | | | | | | | * bpo-21315: Fix parsing of encoded words with missing leading ws. Because of missing leading whitespace, encoded word would get parsed as unstructured token. This patch fixes that by looking for encoded words when splitting tokens with whitespace. Missing trailing whitespace around encoded word now register a defect instead. Original patch suggestion by David R. Murray on bpo-21315.
* [3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620)Serhiy Storchaka2019-06-057-32/+17
| | | Turn deprecation warnings added in 3.8 into TypeError.
* bpo-30835: email: Fix AttributeError when parsing invalid CTE (GH-13598)Abhilash Raj2019-06-041-0/+9
| | | | | | | | | | | | | | | | | | | | * bpo-30835: email: Fix AttributeError when parsing invalid Content-Transfer-Encoding Parsing an email containing a multipart Content-Type, along with a Content-Transfer-Encoding containing an invalid (non-ASCII-decodable) byte will fail. email.feedparser.FeedParser._parsegen() gets the header and attempts to convert it to lowercase before comparing it with the accepted encodings, but as the header contains an invalid byte, it's returned as a Header object rather than a str. Cast the Content-Transfer-Encoding header to a str to avoid this. Found using the AFL fuzzer. Reported-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Andrew Donnellan <andrew@donnellan.id.au> * Add email and NEWS entry for the bugfix.
* bpo-35805: Add parser for Message-ID email header. (GH-13397)Abhilash Raj2019-06-042-0/+100
| | | | | | | | | | | | | * bpo-35805: Add parser for Message-ID header. This parser is based on the definition of Identification Fields from RFC 5322 Sec 3.6.4. This should also prevent folding of Message-ID header using RFC 2047 encoded words and hence fix bpo-35805. * Prevent folding of non-ascii message-id headers. * Add fold method to MsgID token to prevent folding.
* bpo-37153: test_venv.test_mutiprocessing() calls pool.terminate() (GH-13816)Victor Stinner2019-06-041-2/+4
| | | | test_venv.test_mutiprocessing() now explicitly calls pool.terminate() to wait until the pool completes.
* bpo-36742: Corrects fix to handle decomposition in usernames (#13812)Steve Dower2019-06-041-5/+6
|
* bpo-36778: Remove outdated comment from CodePageTest (GH-13807)Victor Stinner2019-06-041-1/+0
| | | CP65001Test has been removed.
* bpo-37142: Make asyncio stream tests more robust again (GH-13804)Andrew Svetlov2019-06-041-9/+16
| | | | Make test_stream_server_close() implementation following test_stream_server_abort(). Add explicit timeout for tests that can hang.
* Make StreamServer.close() tests more robust (GH-13790)Andrew Svetlov2019-06-041-11/+37
|
* bpo-37148: Fix asyncio test that check for warning when running the test ↵Pablo Galindo2019-06-041-0/+4
| | | | suite with huntleaks (GH-13800)
* bpo-35431: Drop the k <= n requirement (GH-13798)Raymond Hettinger2019-06-041-6/+6
|
* Revert "bpo-35621: Support running subprocesses in asyncio when loop is ↵Andrew Svetlov2019-06-042-48/+26
| | | | | executed in non-main thread (#13630)" (GH-13793) https://bugs.python.org/issue35621
* bpo-37120: Add SSLContext.num_tickets (GH-13719)Christian Heimes2019-06-031-0/+18
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-34271: Fix compatibility with 1.0.2 (GH-13728)Christian Heimes2019-06-031-41/+7
| | | | | | Fix various compatibility issues with LibreSSL and OpenSSL 1.0.2 introduced by bpo-34271. Signed-off-by: Christian Heimes <christian@python.org>
* Revert "bpo-33608: Factor out a private, per-interpreter ↵Victor Stinner2019-06-031-1/+1
| | | | | _Py_AddPendingCall(). (gh-13714)" (GH-13780) This reverts commit 6a150bcaeb190d1731b38ab9c7a5d1a352847ddc.
* bpo-37137: Fix test_asyncio: use TestCase.set_event_loop() (GH-13779)Victor Stinner2019-06-031-13/+8
| | | | | | | | | Replace asyncio.set_event_loop() with TestCase.set_event_loop() of test_asyncio.utils: this method calls TestCase.close_loop() which waits until the executor completes, to avoid leaking dangling threads. Inherit from test_asyncio.utils.TestCase rather than unittest.TestCase.
* bpo-26219: per opcode cache for LOAD_GLOBAL (GH-12884)Inada Naoki2019-06-031-3/+3
| | | | | | This patch implements per opcode cache mechanism, and use it in only LOAD_GLOBAL opcode. Based on Yury's opcache3.patch in bpo-26219.
* bpo-35814: Allow unpacking in r.h.s of annotated assignment expressions ↵Pablo Galindo2019-06-031-0/+4
| | | | (GH-13760)
* bpo-33569 Preserve type information with dataclasses.InitVar (GH-8927)Augusto Hack2019-06-031-0/+6
|
* bpo-37069: tests use catch_unraisable_exception() (GH-13762)Victor Stinner2019-06-037-69/+57
| | | | | | | | | | | | | Modify test_coroutines, test_cprofile, test_generators, test_raise, test_ssl and test_yield_from to use support.catch_unraisable_exception() rather than support.captured_stderr(). test_thread: remove test_save_exception_state_on_error() which is now updated. test_unraisable_exception() checks that sys.unraisablehook() is called to handle _thread.start_new_thread() exception. test_cprofile now rely on unittest for test discovery: replace support.run_unittest() with unittest.main().
* bpo-37100: Fix test_coroutines with -Werror (GH-13756)Victor Stinner2019-06-021-4/+4
| | | | test_coroutines: test_unawaited_warning_when_module_broken() now uses support.check_warnings() to catch expected RuntimeWarning.
* bpo-35621: Fix tests when SafeChildWatcher is expected instead of ↵Andrew Svetlov2019-06-021-0/+1
| | | | | ThreadedChildWatcher (GH-13754) https://bugs.python.org/issue35621
* bpo-36974: Make tp_call=PyVectorcall_Call work for inherited types (GH-13699)Petr Viktorin2019-06-021-5/+25
| | | | | | | | | | | | | | | | | | When inheriting a heap subclass from a vectorcall class that sets `.tp_call=PyVectorcall_Call` (as recommended in PEP 590), the subclass does not inherit `_Py_TPFLAGS_HAVE_VECTORCALL`, and thus `PyVectorcall_Call` does not work for it. This attempts to solve the issue by: * always inheriting `tp_vectorcall_offset` unless `tp_call` is overridden in the subclass * inheriting _Py_TPFLAGS_HAVE_VECTORCALL for static types, unless `tp_call` is overridden * making `PyVectorcall_Call` ignore `_Py_TPFLAGS_HAVE_VECTORCALL` This means it'll be ever more important to only call `PyVectorcall_Call` on classes that support vectorcall. In `PyVectorcall_Call`'s intended role as `tp_call` filler, that's not a problem.
* test_gdb.test_pycfunction: test more calling conventions (GH-13668)Petr Viktorin2019-06-021-21/+34
| | | | | As the code paths for various METH_* conventions are diverging due to optimizations, we should check they continue to be covered by GDB integration.
* bpo-36829: test_threading: Fix a ref cycle (GH-13752)Victor Stinner2019-06-021-1/+5
|
* bpo-37124: Fix reference leak in test_msilib (GH-13750)Pablo Galindo2019-06-021-0/+1
|