Message259318
This sort of follows on from other cleanup of test_bytes.py in Issue 19587.
Currently buffer_tests defines one base test class, MixinBytesBufferCommonTests, which is used by test_bytes.py to test bytearray (but not bytes!). However there are other tests defined in test_bytes.py, or string_tests.py, which are run, or could be run, for both bytearray and bytes. I haven’t checking too closely, but I think all the methods in buffer_tests could be merged with other methods and collected into string_tests.BaseTest. Then they would get run for bytes, bytearray, str, and UserString.
The following methods are probably redundant with class string_tests.MixinStrUnicodeUserStringTest (only run for str and UserString). It looks like there is no bytes version of these tests:
* test_islower/upper/title/space/alpha/alnum/digit()
* test_title()
* test_splitlines()
test_capitalize() looks redundant with half of the method in string_tests.CommonTest (also only run for str and UserString). Again there doesn’t seem to be a bytes version of it. I think the common part could be moved into BaseTest, and the unicode-specific part left where it is.
The following are probably also redundant with class string_tests.CommonTest:
* test_ljust/rjust/center()
* test_swapcase()
* test_zfill()
For ljust(), rjust() and center(), there are also tests run for bytes and bytearray in test_bytes.BaseBytesTest that could also be merged at the same time. But swapcase() and zfill() don’t seem to be currently tested for bytes. |
|
Date |
User |
Action |
Args |
2016-02-01 10:49:55 | martin.panter | set | recipients:
+ martin.panter |
2016-02-01 10:49:55 | martin.panter | set | messageid: <1454323795.43.0.12298865479.issue26257@psf.upfronthosting.co.za> |
2016-02-01 10:49:55 | martin.panter | link | issue26257 messages |
2016-02-01 10:49:54 | martin.panter | create | |
|