/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_errors.py

  • Committer: Jelmer Vernooij
  • Date: 2018-08-13 01:38:21 UTC
  • mto: This revision was merged to the branch mainline in revision 7078.
  • Revision ID: jelmer@jelmer.uk-20180813013821-ftxhownoxs1l55qs
Fix some more tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
511
511
    def test_always_str(self):
512
512
        e = PassThroughError(u'\xb5', 'bar')
513
513
        self.assertIsInstance(e.__str__(), str)
514
 
        # In Python str(foo) *must* return a real byte string
 
514
        # In Python 2 str(foo) *must* return a real byte string
515
515
        # not a Unicode string. The following line would raise a
516
516
        # Unicode error, because it tries to call str() on the string
517
517
        # returned from e.__str__(), and it has non ascii characters
518
518
        s = str(e)
519
 
        self.assertEqual('Pass through \xc2\xb5 and bar', s)
 
519
        if PY3:
 
520
            self.assertEqual('Pass through \xb5 and bar', s)
 
521
        else:
 
522
            self.assertEqual('Pass through \xc2\xb5 and bar', s)
520
523
 
521
524
    def test_missing_format_string(self):
522
525
        e = ErrorWithNoFormat(param='randomvalue')