/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/blackbox/test_exceptions.py

  • Committer: Jelmer Vernooij
  • Date: 2018-08-22 02:05:28 UTC
  • mto: This revision was merged to the branch mainline in revision 7102.
  • Revision ID: jelmer@jelmer.uk-20180822020528-j2fg4j8usc30m4s3
Fix some more tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    repository,
29
29
    tests,
30
30
    )
 
31
from breezy.sixish import PY3
31
32
from breezy.bzr.groupcompress_repo import RepositoryFormat2a
32
33
 
33
34
 
51
52
        """
52
53
        if os.name != "posix":
53
54
            raise tests.TestNotApplicable("Needs system beholden to C locales")
54
 
        out, err = self.run_bzr_subprocess(["\xa0"],
 
55
        out, err = self.run_bzr_subprocess([b"\xa0"],
55
56
            env_changes={"LANG": "C", "LC_ALL": "C"},
56
57
            universal_newlines=True,
57
58
            retcode=errors.EXIT_ERROR)
72
73
    "Test that we handle http://bugs.python.org/issue2931"
73
74
 
74
75
    def test_nonascii_optparse(self):
75
 
        """Reasonable error raised when non-ascii in option name"""
76
 
        error_re = 'Only ASCII permitted in option names'
 
76
        """Reasonable error raised when non-ascii in option name on Python 2"""
 
77
        if PY3:
 
78
            error_re = u'no such option: -\xe4'
 
79
        else:
 
80
            error_re = 'Only ASCII permitted in option names'
77
81
        out = self.run_bzr_error([error_re], ['st', u'-\xe4'])
78
82
 
79
83