diff options
author | David Malcolm <dmalcolm@redhat.com> | 2010-04-16 13:15:32 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2010-04-16 13:18:08 -0400 |
commit | bc761965628b9dba93094bb7acfd3b26612fdef1 (patch) | |
tree | ed3c7ea5a3c06205260050438c3b1d5c18382fbe | |
parent | 15c3b04f4257fef54ca5f7ab60012b4936d672a3 (diff) | |
download | pygobject-bc761965628b9dba93094bb7acfd3b26612fdef1.tar.gz pygobject-bc761965628b9dba93094bb7acfd3b26612fdef1.tar.xz pygobject-bc761965628b9dba93094bb7acfd3b26612fdef1.zip |
StandardError went away in Python 3; use Exception instead, as it ought to
work with both Python 2 and Python 3
-rw-r--r-- | tests/test_option.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/test_option.py b/tests/test_option.py index ad5f1b3..beb55bf 100644 --- a/tests/test_option.py +++ b/tests/test_option.py @@ -26,7 +26,7 @@ class TestOption(unittest.TestCase): def _create_group(self): def option_callback(option, opt, value, parser): - raise StandardError(self.EXCEPTION_MESSAGE) + raise Exception(self.EXCEPTION_MESSAGE) group = OptionGroup( "unittest", "Unit test options", "Show all unittest options", @@ -101,7 +101,7 @@ class TestOption(unittest.TestCase): def testOptionGroupConstructor(self): self.assertRaises(TypeError, OptionGroup) - def testStandardError(self): + def testCallbackFailure(self): self._create_group() sio = StringIO() old_stderr = sys.stderr @@ -111,6 +111,7 @@ class TestOption(unittest.TestCase): ["test_option.py", "--callback-failure-test"]) finally: sys.stderr = old_stderr - assert (sio.getvalue().split('\n')[-2] == - "StandardError: " + self.EXCEPTION_MESSAGE) + + self.assertEquals(sio.getvalue().split('\n')[-2], + 'Exception: ' + self.EXCEPTION_MESSAGE) |