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
  (to reflect the type that is now being tested)
  (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.
  (Seems to date back to the first introduction of this code, in 2003!)
  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.)

jdemeyer

iritkatriel

@asqui

@arhadthedev 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

May 18, 2023

@asqui

@hugovk

@asqui asqui mannequin mentioned this pull request

May 18, 2023

@asqui asqui deleted the str-tests-refactor-bpo-36824 branch

May 23, 2023 21:48