diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | gobject/option.py | 4 | ||||
-rw-r--r-- | tests/test_option.py | 7 |
3 files changed, 16 insertions, 2 deletions
@@ -1,3 +1,10 @@ +2008-04-08 Johan Dahlin <jdahlin@async.com.br> + + * gobject/option.py: Fix a typo + * tests/test_option.py: + Update the tests after the latest "refactoring". + The testsuite should run fine now again, finally. + 2008-04-08 Johan Dahlin <johan@gnome.org> * tests/test_gio.py (TestOutputStream.testWriteAsyncError): diff --git a/gobject/option.py b/gobject/option.py index 91424c9..f348b99 100644 --- a/gobject/option.py +++ b/gobject/option.py @@ -1,4 +1,4 @@ -# -*- Mode: Python; py-indent-offset: 4 -*- +# -*- Mode: Python -*- # pygobject - Python bindings for the GObject library # Copyright (C) 2006 Johannes Hoelzl # @@ -316,7 +316,7 @@ class OptionParser(optparse.OptionParser): largs.extend(context.parse([sys.argv[0]] + rargs)) def parse_args(self, args=None, values=None): - old_args = args or 0 + old_args = args or [] try: options, args = optparse.OptionParser.parse_args( self, args, values) diff --git a/tests/test_option.py b/tests/test_option.py index 69e1766..988ce52 100644 --- a/tests/test_option.py +++ b/tests/test_option.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import optparse import unittest import sys from StringIO import StringIO @@ -17,6 +18,10 @@ class TestOption(unittest.TestCase): description="Option unit test") self.parser.add_option("-t", "--test", help="Unit test option", action="store_false", dest="test", default=True) + self.parser.add_option("--g-fatal-warnings", + action="store_true", + dest="fatal_warnings", + help="dummy"), def _create_group(self): def option_callback(option, opt, value, parser): @@ -83,6 +88,7 @@ class TestOption(unittest.TestCase): self.failIf(args) def testOptionValueError(self): + self._create_group() self.assertRaises(option.OptionValueError, self.parser.parse_args, ["test_option.py", "--test-integer=text"]) @@ -95,6 +101,7 @@ class TestOption(unittest.TestCase): self.assertRaises(TypeError, option.OptionGroup) def testStandardError(self): + self._create_group() sio = StringIO() old_stderr = sys.stderr sys.stderr = sio |