From 99eb51b4e10906208a50966ea26f19041c5918ff Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Mon, 19 Jan 2015 15:21:00 +0000 Subject: [PATCH] Fix test_config to skip Unicode environment variable test, when python interpreter is not running in an unicode capable locale. --- debian/changelog | 4 +++- ubuntutools/test/test_config.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index e17abe2..071d20b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,10 @@ ubuntu-dev-tools (0.155) UNRELEASED; urgency=medium * Fix python3 setup.py clean failing to read unicode from debian/changelog. + * Fix test_config to skip Unicode environment variable test, when python + interpreter is not running in an unicode capable locale. - -- Dimitri John Ledkov Sat, 17 Jan 2015 15:40:33 +0000 + -- Dimitri John Ledkov Mon, 19 Jan 2015 14:15:32 +0000 ubuntu-dev-tools (0.154) experimental; urgency=medium diff --git a/ubuntutools/test/test_config.py b/ubuntutools/test/test_config.py index b118b05..7b37009 100644 --- a/ubuntutools/test/test_config.py +++ b/ubuntutools/test/test_config.py @@ -239,6 +239,9 @@ class UbuEmailTestCase(unittest.TestCase): if isinstance(name, bytes): name = 'Jöe Déveloper'.decode('utf-8') env_name = name.encode(encoding) - os.environ['DEBFULLNAME'] = env_name + try: + os.environ['DEBFULLNAME'] = env_name + except UnicodeEncodeError: + raise unittest.SkipTest("python interpreter is not running in an unicode capable locale") os.environ['DEBEMAIL'] = email = 'joe@example.net' self.assertEqual(ubu_email(), (name, email))