gh-81005: Refactor str tests to reflect that str and unicode are merged in Python 3 by asqui · Pull Request #13172 · python/cpython
added 6 commits
May 7, 2019 14:44 (The comment for this mixin class says
# additional tests that only work for
# stringlike objects, i.e. str, UserString
but in the absence of `unicode` the `CommonTest` class is also only
used for these two types now, so no need for the distinction.)
communicate its purpose, and to disambiguate it from the more general `BaseTest` class, which covers behaviours shared with the `bytes` and `bytesarray` types.
non-str types. Back in 2007 there was a change to allow str.join() to convert non-str values automatically, but this is no longer the case.
raising TypeError, so BadSeq1 and the associated check seem to be
redundant. This is the existing check, in test_join():
self.assertRaises(TypeError, '.'.join, ['a', 'b', 3])
(Unless there is some specific difference we're testing by supplying a
custom sequence, BadSeq1, rather than a plain list?)
- Define BadSeq2 closer to its only usage, and give it a more meaningful
name. (Previously this type was referenced from multiple locations but
this is no longer the case.)
arhadthedev
changed the title
bpo-36824: Refactor str tests to reflect that str and unicode are merged in Python 3
gh-81005: Refactor str tests to reflect that str and unicode are merged in Python 3
asqui
mannequin
mentioned this pull request
asqui
deleted the
str-tests-refactor-bpo-36824
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters