Ticket #6393: 6393.branch.patch

File 6393.branch.patch, 1.8 KB (added by Francis Sylvain, 8 years ago)
  • listToPhrase-6393/twisted/trial/test/test_util.py

     
    757757        """
    758758        sample = "One, two, three"
    759759        error = self.assertRaises(TypeError, util._listToPhrase, sample, 'and')
    760         self.assertEqual(error.message, "Things must be a list or a tuple")
     760        self.assertEqual(error.args, ("Things must be a list or a tuple",))
    761761
    762762
    763763    def test_iteratorTypeError(self):
     
    766766        """
    767767        sample = iter([1, 2, 3])
    768768        error = self.assertRaises(TypeError, util._listToPhrase, sample, 'and')
    769         self.assertEqual(error.message, "Things must be a list or a tuple")
     769        self.assertEqual(error.args, ("Things must be a list or a tuple",))
    770770
    771771
    772772    def test_generatorTypeError(self):
     
    777777            for i in range(2):
    778778                yield i
    779779        error = self.assertRaises(TypeError, util._listToPhrase, sample, 'and')
    780         self.assertEqual(error.message, "Things must be a list or a tuple")
     780        self.assertEqual(error.args, ("Things must be a list or a tuple",))
  • listToPhrase-6393/twisted/trial/util.py

     
    439439        strThings = []
    440440        for thing in things:
    441441            strThings.append(str(thing))
    442         return "%s%s%s %s" % (delimiter.join(strThings[:-1]), delimiter, finalDelimiter, strThings[-1])
     442        return "%s%s%s %s" % (delimiter.join(strThings[:-1]),
     443            delimiter, finalDelimiter, strThings[-1])