summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Revert "bpo-35603: Escape table header of make_table output that can cause ↵Serhiy Storchaka2019-01-021-9/+0
| | | | | potential XSS. (GH-11341)" (GH-11356) This reverts commit 78de01198b047347abc5e458851bb12c48429e24.
* bpo-35588: Speed up mod, divmod and floordiv operations for Fraction type ↵Stefan Behnel2019-01-021-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#11322) * bpo-35588: Implement mod and divmod operations for Fraction type by spelling out the numerator/denominator calculation, instead of instantiating and normalising Fractions along the way. This speeds up '%' and divmod() by 2-3x. * bpo-35588: Also reimplement Fraction.__floordiv__() using integer operations to make it ~4x faster. * Improve code formatting. Co-Authored-By: scoder <stefan_ml@behnel.de> * bpo-35588: Fix return type of divmod(): the result of the integer division should be an integer. * bpo-35588: Further specialise __mod__() and inline the original helper function _flat_divmod() since it's no longer reused. * bpo-35588: Add some tests with large numerators and/or denominators. * bpo-35588: Use builtin "divmod()" function for implementing __divmod__() in order to simplify the implementation, even though performance results are mixed. * Rremove accidentally added empty line. * bpo-35588: Try to provide more informative output on test failures. * bpo-35588: Improve wording in News entry. Co-Authored-By: scoder <stefan_ml@behnel.de> * Remove stray space.
* bpo-32492: Tweak _collections._tuplegetter. (GH-11367)Serhiy Storchaka2018-12-312-18/+65
| | | | | | * Replace the docstrings cache with sys.intern(). * Improve tests. * Unify names of tp_descr_get and tp_descr_set functions.
* Fix typo in test module usage message (GH-11374)sth2018-12-311-1/+1
| | | | | A minor typo in the output of `python -m test -h`. A space was missing in between two words. howmuch -> how much
* bpo-35614: Fix pydoc help() on metaclasses (#11357)Sanyam Khurana2018-12-311-0/+11
|
* bpo-35214: Skip test_io tests that'd cause a huge malloc under msan (#11385)Gregory P. Smith2018-12-311-0/+14
| | | | | | | | | | * skip test_constructor under msan. * fix the others as well. * reuse existing related news entry. * typo fix
* Fix typos in test_faulthandler skipIfs for ubsan. (GH-11386)Gregory P. Smith2018-12-311-4/+4
|
* Cleanup test_faulthandler sanitizer skip logic. (GH-11381)Gregory P. Smith2018-12-311-7/+14
| | | | | | | Also skip the same tests when using the undefined behavior sanitizer as they much with the output. Updates a regex in another test to use multi-line mode so that the ubsan buildbot should pass again rather than also adding a skip to that one.
* bpo-35214: MSan workarounds for socket, time, and test_faulthandler. (GH-11375)Gregory P. Smith2018-12-311-0/+9
| | | | | Add Clang Memory Sanitizer build instrumentation to work around false positives from the socket and time modules as well as skipping a couple test_faulthandler tests.
* bpo-32492: 1.6x speed up in namedtuple attribute access using C fast-path ↵Pablo Galindo2018-12-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#10495) * bpo-32492: 2.5x speed up in namedtuple attribute access using C fast path * Add News entry * fixup! bpo-32492: 2.5x speed up in namedtuple attribute access using C fast path * Check for tuple in the __get__ of the new descriptor and don't cache the descriptor itself * Don't inherit from property. Implement GC methods to handle __doc__ * Add a test for the docstring substitution in descriptors * Update NEWS entry to reflect time against 3.7 branch * Simplify implementation with argument clinic, better error messages, only __new__ * Use positional-only parameters for the __new__ * Use PyTuple_GET_SIZE and PyTuple_GET_ITEM to tighter the implementation of tuplegetterdescr_get * Implement __set__ to make tuplegetter a data descriptor * Use Py_INCREF now that we inline PyTuple_GetItem * Apply the valid_index() function, saving one test * Move Py_None test out of the critical path.
* bpo-35602: Make sure the transport is always closed in ↵Pablo Galindo2018-12-291-5/+5
| | | | | SelectorEventLoopUnixSockSendfileTests (GH-11338) There is a race condition in SelectorEventLoopUnixSockSendfileTests that causes the prepare() method return a non connected server protocol, making the cleanup() method skips the correct handling of the transport. This commit makes prepare() always return a connected server protocol that can always be cleaned up correctly.
* bpo-35603: Escape table header of make_table output that can cause potential ↵Xtreak2018-12-291-0/+9
| | | | XSS. (GH-11341)
* Make sure file object is close if socket.create_connection fails (GH-11334)Pablo Galindo2018-12-291-5/+4
| | | The problem affects _testWithTimeoutTriggeredSend in test_socket.py.
* bpo-35601: Alleviate race condition when waiting for SIGALRM in test_asyncio ↵Pablo Galindo2018-12-291-1/+3
| | | | | | (GH-11337) There is a race condition regarding signal delivery in test_signal_handling_args for test_asyncio.test_events.KqueueEventLoopTests. The signal can be received at any moment outside the time window provided in the test. The fix is to wait for the signal to be received instead with a bigger timeout.
* bpo-20849: add dirs_exist_ok arg to shutil.copytree (patch by Josh Bronson)jab2018-12-281-0/+25
|
* bpo-34373: fix test_mktime and test_pthread_getcpuclickid tests on AIX (GH-8726)Michael Felt2018-12-281-8/+7
| | | | | | | | | * Fix test_mktime on AIX by adding code to get mktime to behave the same way as it does on other *nix systems * Fix test_pthread_getcpuclickid in AIX by adjusting the test case expectations when running on AIX in 32-bit mode Patch by Michael Felt.
* bpo-34897: avoid distutils test error when CXX is not set (GH-9706)Michael Felt2018-12-261-1/+1
| | | | | | Depending on system config, a missing candidate compiler name may be reported as the empty string rather than as None, so adjust the test helper accordingly.
* bpo-11192: Skip unsupported cases in test_socket on AIX (GH-8954)Michael Felt2018-12-261-9/+15
| | | | | | * use platform.system() as runtime test, rather than sys.platform() build-time test * IPv6 zone id support on AIX is limited to inet_pton6_zone(), so skip related getaddrinfo() and getnameinfo() tests as not supported
* Revert "bpo-35565: Add detail to assertion failure message in wsgiref" ↵Raymond Hettinger2018-12-251-13/+0
| | | | | (GH-11317) * Revert part of "bpo-35565: Remove incorrect test and one that wasn't needed for the fix.
* bpo-35565: Add detail to assertion failure message in wsgiref (GH-11293)Cheryl Sabella2018-12-251-0/+13
|
* bpo-23867: Argument Clinic: inline parsing code for a single positional ↵Serhiy Storchaka2018-12-251-8/+18
| | | | parameter. (GH-9689)
* bpo-20180: Simplify char_converter in Argument Clinic. (GH-9828)Serhiy Storchaka2018-12-251-14/+16
| | | Fix also handling non-ascii default values.
* bpo-35578: Add an example file for testing Argument Clinic converters. ↵Serhiy Storchaka2018-12-252-1/+1324
| | | | (GH-11306)
* bpo-30561: Sync-up expovariate() and gammavariate code (GH-1934)leodema2018-12-241-11/+31
|
* bpo-30455: Generate all token related code and docs from Grammar/Tokens. ↵Serhiy Storchaka2018-12-222-1/+6
| | | | | | | | | | | | | | | | | | | (GH-10370) "Include/token.h", "Lib/token.py" (containing now some data moved from "Lib/tokenize.py") and new files "Parser/token.c" (containing the code moved from "Parser/tokenizer.c") and "Doc/library/token-list.inc" (included in "Doc/library/token.rst") are now generated from "Grammar/Tokens" by "Tools/scripts/generate_token.py". The script overwrites files only if needed and can be used on the read-only sources tree. "Lib/symbol.py" is now generated by "Tools/scripts/generate_symbol_py.py" instead of been executable itself. Added new make targets "regen-token" and "regen-symbol" which are now dependencies of "regen-all". The documentation contains now strings for operators and punctuation tokens.
* bpo-34193: Fix pluralization in getargs.c and test cases. (GH-8438)Xtreak2018-12-212-8/+11
|
* bpo-35424: emit ResourceWarning at multiprocessing.Pool destruction (GH-10974)Victor Stinner2018-12-201-0/+16
| | | | multiprocessing.Pool destructor now emits ResourceWarning if the pool is still running.
* bpo-5438: Update memory requirements and optimize test_bigmem.py. (GH-11123)Serhiy Storchaka2018-12-201-68/+69
|
* bpo-35257: Avoid leaking LTO linker flags into distutils (GH-10900)stratakis2018-12-192-1/+4
| | | | | | When compiling 3rd party C extensions, the linker flags used by the compiler for the interpreter and the stdlib modules, will get leaked into distutils. In order to avoid that, the PY_CORE_LDFLAGS and PY_LDFLAGS_NODIST are introduced to keep those flags separated.
* bpo-35424: Fix test_multiprocessing_main_handling (GH-11223)Victor Stinner2018-12-181-18/+24
| | | | Fix test_multiprocessing_main_handling: use multiprocessing.Pool with a context manager and then explicitly join the pool.
* bpo-31731: Fix test_io.check_interrupted_write() (GH-11225)Victor Stinner2018-12-181-3/+9
| | | | | | | Fix a race condition in check_interrupted_write() of test_io: create directly the thread with SIGALRM signal blocked, rather than blocking the signal later from the thread. Previously, it was possible that the thread gets the signal before the signal is blocked.
* bpo-23057: add loop self socket as wakeup fd for signals (#11135)Vladimir Matveev2018-12-183-5/+89
|
* bpo-35502: Fix reference leaks in ElementTree.TreeBuilder. (GH-11170)Serhiy Storchaka2018-12-181-0/+21
|
* bpo-31784: Use time.time_ns() in uuid.uuid1() (GH-11189)Victor Stinner2018-12-181-0/+18
| | | | | uuid.uuid1() now calls time.time_ns() rather than int(time.time() * 1e9). Replace also int(nanoseconds/100) with nanoseconds // 100. Add an unit test.
* bpo-35519: Rename test.bisect to test.bisect_cmd (GH-11200)Victor Stinner2018-12-172-1/+1
| | | | | Rename test.bisect module to test.bisect_cmd to avoid conflict with bisect module when running directly a test like "./python Lib/test/test_xmlrpc.py".
* bpo-33306: Improve SyntaxError messages for unbalanced parentheses. (GH-6516)Serhiy Storchaka2018-12-172-6/+10
|
* bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. ↵Zackery Spytz2018-12-175-4/+32
| | | | (GH-11175)
* bpo-35504: Fix a SystemError when delete the characters_written attribute of ↵Serhiy Storchaka2018-12-171-0/+5
| | | | an OSError. (GH-11172)
* bpo-18799: Resurrect test_404 in test_xmlrpc. (GH-11196)Vajrasky Kok2018-12-171-3/+2
|
* bpo-35415: validate fileno argument to socket.socket (GH-10917)Dima Tisnek2018-12-171-5/+44
| | | https://bugs.python.org/issue35415
* bpo-35513, unittest: TextTestRunner uses time.perf_counter() (GH-11180)Victor Stinner2018-12-172-8/+8
| | | | | | | TextTestRunner of unittest.runner now uses time.perf_counter() rather than time.time() to measure the execution time of a test: time.time() can go backwards, whereas time.perf_counter() is monotonic. Similar change made in libregrtest, pprint and random.
* bpo-35513: Replace time.time() with time.monotonic() in tests (GH-11182)Victor Stinner2018-12-1712-64/+64
| | | | | | | Replace time.time() with time.monotonic() in tests to measure time delta. test_zipfile64: display progress every minute (60 secs) rather than every 5 minutes (5*60 seconds).
* bpo-35471: Remove the macpath module (GH-11129)Victor Stinner2018-12-142-161/+2
| | | | Python 2.4 dropped MacOS 9 support. The macpath module was deprecated in Python 3.7. This change removes it.
* bpo-34279: regrtest consider that skipped tests are ran (GH-11132)Victor Stinner2018-12-142-1/+15
| | | | | | bpo-34279, bpo-35412: support.run_unittest() no longer raises TestDidNotRun if a test result contains skipped tests. The exception is now only raised if no test have been run and no test have been skipped.
* bpo-35477: multiprocessing.Pool.__enter__() fails if called twice (GH-11134)Victor Stinner2018-12-131-0/+16
| | | | multiprocessing.Pool.__enter__() now fails if the pool is not running: "with pool:" fails if used more than once.
* bpo-35412: Add testcase to test_future4 (GH-11131)Victor Stinner2018-12-121-1/+6
| | | Add testcase to test_future4: check unicode literal.
* bpo-33106: change dbm key deletion error for readonly file from KeyError to ↵Xiang Zhang2018-12-123-2/+24
| | | | | | dbm.error (#6295)
* bpo-35394: Add empty slots to abstract asyncio protocols (#10889)Andrew Svetlov2018-12-112-24/+57
| | | | | | * bpo-35394: Add empty slots to abstract asyncio protocols * Add missing test file
* bpo-35426: Eliminate race condition in test_interprocess_signal (GH-11087)Pablo Galindo2018-12-111-22/+18
| | | The test only except SIGUSR1Exception inside wait_signal(), but the signal can be sent during subprocess_send_signal() call.
* bpo-35412: Skip test_multiprocessing_fork and ↵Pablo Galindo2018-12-112-0/+7
| | | | | test_multiprocessing_forkserver on Windows (GH-11086) Forkserver and fork are not available on Windows and therefore these test must be skipped.