summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_buffer.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-114685: PyBuffer_FillInfo() now raises on PyBUF_{READ,WRITE} (GH-114802)Nikita Sobolev2024-02-041-0/+21
|
* gh-114685: Check flags in PyObject_GetBuffer() (GH-114707)Serhiy Storchaka2024-01-311-0/+6
| | | | | PyObject_GetBuffer() now raises a SystemError if called with PyBUF_READ or PyBUF_WRITE as flags. These flags should only be used with the PyMemoryView_* C API.
* gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421)Serhiy Storchaka2023-09-021-0/+2
| | | | Only mark tests which spend significant system or user time, by itself or in subprocesses.
* gh-106197: Deduplicate tests in `test_buffer` (#106198)Nikita Sobolev2023-06-281-1/+1
|
* gh-80480: Emit DeprecationWarning for array's 'u' type code (#95760)Hugo van Kemenade2023-06-111-6/+10
|
* gh-104371: Fix calls to `__release_buffer__` while an exception is active ↵Jelle Zijlstra2023-05-121-0/+13
| | | | | (#104378) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-104223: Fix issues with inheriting from buffer classes (#104227)Jelle Zijlstra2023-05-081-0/+170
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-102500: Implement PEP 688 (#102521)Jelle Zijlstra2023-05-041-0/+142
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-83791: Raise TypeError for len(memoryview_0d) (#18463)Eric Wieser2023-04-221-2/+4
| | | Changes the behaviour of `len` on a zero-dimensional `memoryview` to raise `TypeError`. Previously, `len` would return `1`.
* gh-90751: memoryview now supports half-float (#96738)Dong-hee Na2022-09-101-7/+13
| | | | Co-authored-by: Antoine Pitrou <antoine@python.org>
* bpo-40275: Use new test.support helper submodules in tests (GH-21151)Hai Shi2020-06-251-1/+2
| | | | | | | | | | | | | Use new test.support helper submodules in tests: * distutils tests * test_buffer * test_compile * test_filecmp * test_fileinput * test_readline * test_smtpnet * test_structmembers * test_tools
* bpo-39689: Do not test undefined casts to _Bool (GH-18964)Stefan Krah2020-03-121-0/+4
| | | - When casting to _Bool, arrays should only contain zeros or ones.
* bpo-35712: Make using NotImplemented in a boolean context issue a ↵MojoVampire2020-03-031-1/+1
| | | | deprecation warning (GH-13195)
* Give proper credit for figuring out and writing PEP-3118 tests. (#18644)Stefan Krah2020-02-241-0/+2
|
* bpo-38839: Fix some unused functions in tests (GH-17189)Adam Johnson2019-11-191-2/+0
|
* Unmark files as executable that can't actually be executed. (GH-15353)Greg Price2019-08-211-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are plenty of legitimate scripts in the tree that begin with a `#!`, but also a few that seem to be marked executable by mistake. Found them with this command -- it gets executable files known to Git, filters to the ones that don't start with a `#!`, and then unmarks them as executable: $ git ls-files --stage \ | perl -lane 'print $F[3] if (!/^100644/)' \ | while read f; do head -c2 "$f" | grep -qxF '#!' \ || chmod a-x "$f"; \ done Looking at the list by hand confirms that we didn't sweep up any files that should have the executable bit after all. In particular * The `.psd` files are images from Photoshop. * The `.bat` files sure look like things that can be run. But we have lots of other `.bat` files, and they don't have this bit set, so it must not be needed for them. Automerge-Triggered-By: @benjaminp
* bpo-15913: Implement PyBuffer_SizeFromFormat() (GH-13873)Joannah Nanjekye2019-08-201-0/+12
| | | | Implement PyBuffer_SizeFromFormat() function (previously documented but not implemented): call struct.calcsize().
* bpo-35845: Add order={'C', 'F', 'A'} parameter to memoryview.tobytes(). (#11730)Stefan Krah2019-02-021-0/+15
|
* bpo-34201: Tweak test_buffer. (GH-8481)Serhiy Storchaka2018-07-261-3/+2
|
* bpo-34201: Make ndarray.readonly a bool and use stricter tests in ↵Serhiy Storchaka2018-07-261-40/+40
| | | | test_buffer. (GH-8414)
* bpo-33176: Add a toreadonly() method to memoryviews. (GH-6466)Antoine Pitrou2018-04-141-16/+23
|
* bpo-31792: Restore os.environ in test_buffer when import numpy. (#4007)Serhiy Storchaka2017-10-161-2/+3
|
* Issue #23277: Remove unused imports in tests.Serhiy Storchaka2016-04-241-1/+0
|
* Iaaue #25598: Fix memory_hex from #9951 for non-contiguous buffers.Stefan Krah2015-11-101-0/+5
|
* Issue #15944: memoryview: Allow arbitrary formats when casting to bytes.Stefan Krah2015-08-081-2/+27
| | | | Original patch by Martin Panter.
* Issue #23681: Fixed Python 2 to 3 poring bugs.Serhiy Storchaka2015-03-201-4/+4
|\ | | | | | | Indexing bytes retiurns an integer, not bytes.
| * Issue #23681: Fixed Python 2 to 3 poring bugs.Serhiy Storchaka2015-03-201-4/+4
| | | | | | | | Indexing bytes retiurns an integer, not bytes.
* | Issue #23632: Memoryviews now allow tuple indexing (including for ↵Antoine Pitrou2015-03-191-6/+50
| | | | | | | | multi-dimensional memoryviews).
* | Issue #23629: Fix the default __sizeof__ implementation for variable-sized ↵Antoine Pitrou2015-03-101-0/+15
|\ \ | |/ | | | | objects.
| * Issue #23629: Fix the default __sizeof__ implementation for variable-sized ↵Antoine Pitrou2015-03-101-0/+15
| | | | | | | | objects.
* | Issue #22445: PyBuffer_IsContiguous() now implements precise contiguityStefan Krah2015-02-011-0/+13
| | | | | | | | | | tests, compatible with NumPy's NPY_RELAXED_STRIDES_CHECKING compilation flag. Previously the function reported false negatives for corner cases.
* | PEP 479: Use the return-keyword instead of raising StopIteration inside a ↵Raymond Hettinger2014-11-231-1/+1
|/ | | | generators.
* Issue #19014: memoryview.cast() is now allowed on zero-length views.Antoine Pitrou2013-10-031-3/+10
|\
| * Issue #19014: memoryview.cast() is now allowed on zero-length views.Antoine Pitrou2013-10-031-3/+10
| |
| * Backport fc8f1b1c76bf.Stefan Krah2012-11-061-14/+4
| |
* | Update various test modules to use unittest.main() for test discoveryBrett Cannon2013-06-131-5/+1
| | | | | | | | instead of manually listing tests for test.support.run_unittest().
* | Fix copy&paste errors and reformulate the tests.Stefan Krah2012-11-041-14/+4
|/
* Issue #15814: Use hash function that is compatible with the equalityStefan Krah2012-11-021-2/+30
| | | | definition from #15573.
* Close #15573: use value-based memoryview comparisons (patch by Stefan Krah)Nick Coghlan2012-08-251-68/+430
|
* Issue #15770: Check invalid arguments in test function. Patch by Victor Stinner.Stefan Krah2012-08-231-0/+2
|
* The latest NumPy revision no longer segfaults here.Stefan Krah2012-08-191-6/+0
|
* Issue #12834: Fix PyBuffer_ToContiguous() for non-contiguous arrays.Stefan Krah2012-07-281-1/+290
|
* Issue #14779: Get sizeof(void *) directly rather than relying on sysconfig.Stefan Krah2012-05-161-4/+2
|
* Issue #14779: Do not use get_config_var('SIZEOF_VOID_P') on OS X 64-/32-bitStefan Krah2012-05-121-3/+3
| | | | | universal: it returns a meaningless result. Use sys.maxsize instead of platform.architecture as a fallback. Patch by Ned Deily.
* Issue #14181: Preserve backwards compatibility for getbufferprocs that a) doStefan Krah2012-03-051-0/+6
| | | | | not adhere to the new documentation and b) manage to clobber view->obj before returning failure.
* Issue #14181: Test creating memoryviews from a static exporter with bothStefan Krah2012-03-051-0/+94
| | | | view.obj==NULL and view.obj==base.
* Issue #10181: The decision was to raise a buffer error in memory_exit()Stefan Krah2012-03-051-5/+6
| | | | | if the view has exported buffers. Make this official by uncommenting a test case.
* Issue #14181: Allow memoryview construction from an object that uses theStefan Krah2012-03-051-0/+90
| | | | getbuffer redirection scheme.
* - Issue #10181: New memoryview implementation fixes multiple ownershipStefan Krah2012-02-251-0/+3437
| | | | | | | | | | | | | | | | | | and lifetime issues of dynamically allocated Py_buffer members (#9990) as well as crashes (#8305, #7433). Many new features have been added (See whatsnew/3.3), and the documentation has been updated extensively. The ndarray test object from _testbuffer.c implements all aspects of PEP-3118, so further development towards the complete implementation of the PEP can proceed in a test-driven manner. Thanks to Nick Coghlan, Antoine Pitrou and Pauli Virtanen for review and many ideas. - Issue #12834: Fix incorrect results of memoryview.tobytes() for non-contiguous arrays. - Issue #5231: Introduce memoryview.cast() method that allows changing format and shape without making a copy of the underlying memory.
* Breaking ground for PEP 3137 implementation:Guido van Rossum2007-10-081-56/+0
| | | | | | Get rid of buffer(). Use memoryview() in its place where possible. In a few places, do things a bit different, because memoryview() can't slice (yet).