Commit Graph

42 Commits

Author SHA1 Message Date
Hai Shi
847f94f47b bpo-40275: Use new test.support helper submodules in tests (GH-21151)
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
2020-06-25 19:17:57 +02:00
Stefan Krah
1ae9cde4b2 bpo-39689: Do not test undefined casts to _Bool (GH-18964)
- When casting to _Bool, arrays should only contain zeros or ones.
2020-03-12 19:35:38 +01:00
MojoVampire
469325c30e bpo-35712: Make using NotImplemented in a boolean context issue a deprecation warning (GH-13195) 2020-03-03 20:50:17 +02:00
Stefan Krah
b942ba03b8 Give proper credit for figuring out and writing PEP-3118 tests. (#18644) 2020-02-24 12:24:43 +01:00
Adam Johnson
892221bfa0 bpo-38839: Fix some unused functions in tests (GH-17189) 2019-11-19 11:45:20 -08:00
Greg Price
9ece4a5057 Unmark files as executable that can't actually be executed. (GH-15353)
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
2019-08-20 21:53:59 -07:00
Joannah Nanjekye
9e66aba999 bpo-15913: Implement PyBuffer_SizeFromFormat() (GH-13873)
Implement PyBuffer_SizeFromFormat() function (previously
documented but not implemented): call struct.calcsize().
2019-08-20 15:46:36 +01:00
Stefan Krah
d08ea70464 bpo-35845: Add order={'C', 'F', 'A'} parameter to memoryview.tobytes(). (#11730) 2019-02-02 18:57:41 +01:00
Serhiy Storchaka
3b5342caaa bpo-34201: Tweak test_buffer. (GH-8481) 2018-07-26 17:34:07 +03:00
Serhiy Storchaka
e0d67f17cc bpo-34201: Make ndarray.readonly a bool and use stricter tests in test_buffer. (GH-8414) 2018-07-26 13:23:03 +03:00
Antoine Pitrou
480ab05d5f bpo-33176: Add a toreadonly() method to memoryviews. (GH-6466) 2018-04-14 19:49:21 +02:00
Serhiy Storchaka
676db4bbf2 bpo-31792: Restore os.environ in test_buffer when import numpy. (#4007) 2017-10-16 10:38:14 +03:00
Serhiy Storchaka
e437a10d15 Issue #23277: Remove unused imports in tests. 2016-04-24 21:41:02 +03:00
Stefan Krah
0ce5b6e268 Iaaue #25598: Fix memory_hex from #9951 for non-contiguous buffers. 2015-11-10 18:17:22 +01:00
Stefan Krah
0c51595a78 Issue #15944: memoryview: Allow arbitrary formats when casting to bytes.
Original patch by Martin Panter.
2015-08-08 13:38:10 +02:00
Serhiy Storchaka
ee4c0b9dcf Issue #23681: Fixed Python 2 to 3 poring bugs.
Indexing bytes retiurns an integer, not bytes.
2015-03-20 16:48:02 +02:00
Serhiy Storchaka
74a49ac3f5 Issue #23681: Fixed Python 2 to 3 poring bugs.
Indexing bytes retiurns an integer, not bytes.
2015-03-20 16:46:19 +02:00
Antoine Pitrou
31084ba528 Issue #23632: Memoryviews now allow tuple indexing (including for multi-dimensional memoryviews). 2015-03-19 23:29:36 +01:00
Antoine Pitrou
63afdaa110 Issue #23629: Fix the default __sizeof__ implementation for variable-sized objects. 2015-03-10 22:35:24 +01:00
Antoine Pitrou
a654510150 Issue #23629: Fix the default __sizeof__ implementation for variable-sized objects. 2015-03-10 22:32:00 +01:00
Stefan Krah
363af44a4a Issue #22445: PyBuffer_IsContiguous() now implements precise contiguity
tests, compatible with NumPy's NPY_RELAXED_STRIDES_CHECKING compilation
flag.  Previously the function reported false negatives for corner cases.
2015-02-01 14:53:54 +01:00
Raymond Hettinger
bb6c0aaebf PEP 479: Use the return-keyword instead of raising StopIteration inside a generators. 2014-11-22 22:14:41 -08:00
Antoine Pitrou
0e61ed8400 Issue #19014: memoryview.cast() is now allowed on zero-length views. 2013-10-03 19:56:54 +02:00
Antoine Pitrou
60b183407c Issue #19014: memoryview.cast() is now allowed on zero-length views. 2013-10-03 19:55:41 +02:00
Brett Cannon
3e9a9ae09d Update various test modules to use unittest.main() for test discovery
instead of manually listing tests for test.support.run_unittest().
2013-06-12 21:25:59 -04:00