summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* bpo-30040: new empty dict uses key-sharing dict (GH-1080)Inada Naoki2019-03-122-4/+6
| | | | Sizeof new empty dict becomes 72 bytes from 240 bytes (amd64). It is same size to empty dict created by dict.clear().
* bpo-35892: Fix mode() and add multimode() (#12089)Raymond Hettinger2019-03-121-8/+19
|
* bpo-35931: Gracefully handle any exception in pdb debug command (GH-12103)Daniel Hahler2019-03-121-4/+18
| | | | This is relevant for `debug doesnotexist()`, which would crash with a NameError otherwise.
* bpo-36234: Add more tests to PosixUidGidTests (GH-12234)Victor Stinner2019-03-111-8/+20
| | | | | | | | | | test_posix.PosixUidGidTests: * Add tests for invalid uid/gid type (str) * Add UID_OVERFLOW and GID_OVERFLOW constants to replace (1 << 32) Initial patch written by David Malcolm. Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
* bpo-35647: Fix path check in cookiejar (#11436)Xtreak2019-03-101-0/+24
| | | | | | | | | | | | * Refactor cookie path check as per RFC 6265 * Add tests for prefix match of path * Add news entry * Fix set_ok_path and refactor tests * Use slice for last letter
* bpo-35121: prefix dot in domain for proper subdomain validation (GH-10258)Xtreak2019-03-101-0/+30
| | | Don't send cookies of domain A without Domain attribute to domain B when domain A is a suffix match of domain B while using a cookiejar with `http.cookiejar.DefaultCookiePolicy` policy. Patch by Karthikeyan Singaravelan.
* closes bpo-33376: Update to Unicode 12.0.0. (GH-12256)Benjamin Peterson2019-03-101-2/+2
|
* Rework integer overflow path in math.prod and add more tests (GH-11809)Pablo Galindo2019-03-091-35/+86
| | | | | The overflow check was relying on undefined behaviour as it was using the result of the multiplication to do the check, and once the overflow has already happened, any operation on the result is undefined behaviour. Some extra checks that exercise code paths related to this are also added.
* bpo-35661: Store the venv prompt in pyvenv.cfg (GH-11440)Cheryl Sabella2019-03-081-0/+6
|
* bpo-35843: Implement __getitem__ for _NamespacePath (GH-11690)Anthony Sottile2019-03-081-0/+6
|
* bpo-35975: Support parsing earlier minor versions of Python 3 (GH-12086)Guido van Rossum2019-03-072-42/+103
| | | | | | | This adds a `feature_version` flag to `ast.parse()` (documented) and `compile()` (hidden) that allow tweaking the parser to support older versions of the grammar. In particular if `feature_version` is 5 or 6, the hacks for the `async` and `await` keyword from PEP 492 are reinstated. (For 7 or higher, these are unconditionally treated as keywords, but they are still special tokens rather than `NAME` tokens that the parser driver recognizes.) https://bugs.python.org/issue35975
* bpo-36216: Add check for characters in netloc that normalize to separators ↵Steve Dower2019-03-071-0/+23
| | | | (GH-12201)
* Refine statistics.NormalDist documentation and improve test coverage (GH-12208)Raymond Hettinger2019-03-071-1/+2
|
* bpo-36169 : Add overlap() method to statistics.NormalDist (GH-12149)Raymond Hettinger2019-03-071-0/+62
|
* bpo-36142: PYTHONMALLOC overrides PYTHONDEV (GH-12191)Victor Stinner2019-03-061-2/+8
| | | | | | | | bpo-34247, bpo-36142: The PYTHONMALLOC environment variable has the priority over PYTHONDEV env var and "-X dev" command line option. For example, PYTHONMALLOC=malloc PYTHONDEVMODE=1 sets the memory allocators to "malloc" (and not to "debug"). Add an unit test.
* Add more tests for pdf() and cdf() (GH-12190)Raymond Hettinger2019-03-061-3/+29
|
* bpo-36142: Add _PyPreConfig_SetAllocator() (GH-12187)Victor Stinner2019-03-061-3/+2
| | | | | | | | | | | * _PyPreConfig_Write() now reallocates the pre-configuration with the new memory allocator. * It is no longer needed to force the "default raw memory allocator" to clear pre-configuration and core configuration. Simplify the code. * _PyPreConfig_Write() now does nothing if called after Py_Initialize(): no longer check if the allocator is the same. * Remove _PyMem_GetDebugAllocatorsName(): dev mode sets again allocator to "debug".
* bpo-36142: Add _PyMem_GetDebugAllocatorsName() (GH-12185)Victor Stinner2019-03-051-2/+3
| | | | | The development mode now uses the effective name of the debug memory allocator ("pymalloc_debug" or "malloc_debug"). So the name doesn't change after setting the memory allocator.
* bpo-36187: Remove NamedStore. (GH-12167)Serhiy Storchaka2019-03-051-0/+4
| | | | | NamedStore has been replaced with Store. The difference between NamedStore and Store is handled when precess the NamedExpr node one level upper.
* bpo-36142: Add _PyPreConfig.allocator (GH-12181)Victor Stinner2019-03-051-23/+29
| | | | | | * Move 'allocator' and 'dev_mode' fields from _PyCoreConfig to _PyPreConfig. * Fix InitConfigTests of test_embed: dev_mode sets allocator to "debug", add a new tests for env vars with dev mode enabled.
* bpo-22831: Use "with" to avoid possible fd leaks in tests (part 2). (GH-10929)Serhiy Storchaka2019-03-0525-323/+264
|
* bpo-22831: Use "with" to avoid possible fd leaks in tests (part 1). (GH-10928)Serhiy Storchaka2019-03-055-298/+254
|
* bpo-35899: Fix Enum handling of empty and weird strings (GH-11891)Brennan D Baraban2019-03-031-0/+17
| | | | | | | | | | Co-authored-by: Maxwell <maxwellpxt@gmail.com> Co-authored-by: Stéphane Wirtel <stephane@wirtel.be> https://bugs.python.org/issue35899
* fixed duplicated method name of test_getuserbase() (GH-12140)native-api2019-03-031-1/+3
|
* bpo-36043: FileCookieJar supports os.PathLike (GH-11945)Stéphane Wirtel2019-03-011-0/+25
| | | https://bugs.python.org/issue36043
* bpo-35178: Fix warnings._formatwarnmsg() (GH-12033)Xtreak2019-03-011-0/+19
| | | | | Ensure custom formatwarning function can receive line as positional argument. Co-Authored-By: Tashrif Billah <tashrifbillah@gmail.com>
* bpo-36142: Remove _PyMain structure (GH-12120)Victor Stinner2019-03-011-0/+5
| | | | | | | | | | | | | * Move fields from _PyMain to _PyCoreConfig: * skip_first_line * run_command * run_module * run_filename * Replace _PyMain.stdin_is_interactive with a new stdin_is_interactive(config) function * Rename _PyMain to _PyArgv. Add "const _PyArgv *args" field to _PyCmdline.
* bpo-36155: Check for identity on test_gc.test_get_objects (GH-12116)Pablo Galindo2019-03-011-12/+36
|
* bpo-29571: Fix test_re.test_locale_flag() (GH-12099)Victor Stinner2019-02-281-2/+1
| | | | | | | | | Use locale.getpreferredencoding() rather than locale.getlocale() to get the locale encoding. With some locales, locale.getlocale() returns the wrong encoding. For example, on Fedora 29, locale.getlocale() returns ISO-8859-1 encoding for the "en_IN" locale, whereas locale.getpreferredencoding() reports the correct encoding: UTF-8.
* bpo-36018: Add special value tests and make minor tweaks to the docs (GH-12096)Raymond Hettinger2019-02-281-0/+8
| | | https://bugs.python.org/issue36018
* bpo-36123: Fix test_socket.testWithTimeoutTriggeredSend() race condition ↵Joannah Nanjekye2019-02-261-2/+3
| | | | | | (GH-12053) Use longer timeout for accept() in the server and block on accept in the client. The client now only sets the timeout once the socket is connected.
* bpo-35652: shutil.copytree(copy_function=...) erroneously pass DirEntry ↵Giampaolo Rodola2019-02-261-0/+18
| | | | instead of path str (GH-11997)
* bpo-36109: Fix random test_descr failure. (GH-12044)Serhiy Storchaka2019-02-261-1/+5
|
* Clean up code which checked presence of os.{stat,lstat,chmod} (#11643)Anthony Sottile2019-02-2511-39/+9
|
* bpo-36048: Use __index__() instead of __int__() for implicit conversion if ↵Serhiy Storchaka2019-02-255-13/+110
| | | | | | available. (GH-11952) Deprecate using the __int__() method in implicit conversions of Python numbers to C integers.
* bpo-36018: Add properties for mean and stdev (GH-12022)Raymond Hettinger2019-02-241-0/+6
| | | | | | | | | | | | Responding to suggestions on the tracker and some off-line suggestions. Davin suggested that english named accessors instead of greek letters would result in more intelligible user code. Steven suggested that the parameters still need to be *mu* and *theta* which are used elsewhere (and I noted those parameter names are used in linked-to resources). Michael suggested proving-out the API by seeing whether it generalized to *Lognormal*. I did so and found that Lognormal distribution parameters *mu* and *sigma* do not represent the mean and standard deviation of the lognormal distribution (instead, they are for the underlying regular normal distribution). Putting these ideas together, we have NormalDist parameterized by *mu* and *sigma* but offering English named properties for accessors. That gives lets us match other API that access mu and sigma, it matches the external resources on the topic, gives us clear english names in user code. The API extends nicely to LogNormal where the parameters and the summary statistic accessors are not the same. https://bugs.python.org/issue36018
* bpo-36018: Make __pos__ return a distinct instance of NormDist (GH-12009)Raymond Hettinger2019-02-241-0/+12
| | | https://bugs.python.org/issue36018
* bpo-35813: Tests and docs for shared_memory (#11816)Davin Potts2019-02-241-33/+285
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added tests for shared_memory submodule. * Added tests for ShareableList. * Fix bug in allocationn size during creation of empty ShareableList illuminated by existing test run on Linux. * Initial set of docs for shared_memory module. * Added docs for ShareableList, added doctree entry for shared_memory submodule, name refactoring for greater clarity. * Added examples to SharedMemoryManager docs, for ease of documentation switched away from exclusively registered functions to some explicit methods on SharedMemoryManager. * Wording tweaks to docs. * Fix test failures on Windows. * Added tests around SharedMemoryManager. * Documentation tweaks. * Fix inappropriate test on Windows. * Further documentation tweaks. * Fix bare exception. * Removed __copyright__. * Fixed typo in doc, removed comment. * Updated SharedMemoryManager preliminary tests to reflect change of not supporting all registered functions on SyncManager. * Added Sphinx doctest run controls. * CloseHandle should be in a finally block in case MapViewOfFile fails. * Missed opportunity to use with statement. * Switch to self.addCleanup to spare long try/finally blocks and save one indentation, change to use decorator to skip test instead. * Simplify the posixshmem extension module. Provide shm_open() and shm_unlink() functions. Move other functionality into the shared_memory.py module. * Added to doc around size parameter of SharedMemory. * Changed PosixSharedMemory.size to use os.fstat. * Change SharedMemory.buf to a read-only property as well as NamedSharedMemory.size. * Marked as provisional per PEP411 in docstring. * Changed SharedMemoryTracker to be private. * Removed registered Proxy Objects from SharedMemoryManager. * Removed shareable_wrap(). * Removed shareable_wrap() and dangling references to it. * For consistency added __reduce__ to key classes. * Fix for potential race condition on Windows for O_CREX. * Remove unused imports. * Update access to kernel32 on Windows per feedback from eryksun. * Moved kernel32 calls to _winapi. * Removed ShareableList.copy as redundant. * Changes to _winapi use from eryksun feedback. * Adopt simpler SharedMemory API, collapsing PosixSharedMemory and WindowsNamedSharedMemory into one. * Fix missing docstring on class, add test for ignoring size when attaching. * Moved SharedMemoryManager to managers module, tweak to fragile test. * Tweak to exception in OpenFileMapping suggested by eryksun. * Mark a few dangling bits as private as suggested by Giampaolo.
* bpo-36018: Add the NormalDist class to the statistics module (GH-11973)Raymond Hettinger2019-02-231-0/+177
|
* bpo-36016: Add generation option to gc.getobjects() (GH-11909)Pablo Galindo2019-02-231-0/+32
|
* bpo-36019: Use pythontest.net instead of example.com in network tests (GH-11941)Stéphane Wirtel2019-02-224-10/+16
|
* bpo-35904: Add statistics.fmean() (GH-11892)Raymond Hettinger2019-02-211-0/+45
|
* bpo-36068: Make _tuplegetter objects serializable (GH-11981)Joe Jevnik2019-02-211-1/+10
|
* bpo-36057 Update docs and tests for ordering in collections.Counter [no ↵Raymond Hettinger2019-02-211-0/+57
| | | | | | | | | | behavior change] (#11962) * Add tests for Counter order. No behavior change. * Update docs and tests * Fix doctest output and capitalization
* bpo-36060: Document how collections.ChainMap() determines iteration order ↵Raymond Hettinger2019-02-211-0/+14
| | | | (GH-11969)
* bpo-36052: Raise a SyntaxError when assigning a value to __debug__ with := ↵Stéphane Wirtel2019-02-211-0/+4
| | | | | | | (GH-11958) Trying to assign a value to __debug__ using the assignment operator is supposed to fail, but a missing check for forbidden names when setting the context in the ast was preventing this behaviour.
* bpo-36037: Fix test_ssl for strict OpenSSL policy (GH-11940)Victor Stinner2019-02-191-1/+29
| | | | | Fix test_ssl for strict OpenSSL configuration like RHEL8 strict crypto policy. Use older TLS version for minimum TLS version of the server SSL context if needed, to test TLS version older than default minimum TLS version.
* bpo-35153: Add headers parameter to xmlrpc.client.ServerProxy (GH-10308)Cédric Krier2019-02-191-1/+62
| | | Allow to add HTTP headers to XML-RPC requests sent to the server.
* bpo-31506: Clarify error messages for object.__new__ and object.__init__ ↵Sanyam Khurana2019-02-191-7/+13
| | | | | | | | | (GH-11641) `object.__new__` and `object.__init__` do take one argument each, they just don't take extra user supplied arguments. Patch by Sanyam Khurana.
* Fix a misnamed test for lists. (GH-11933)Serhiy Storchaka2019-02-191-1/+7
|