summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Dahlin <jdahlin@async.com.br>2008-04-08 18:15:55 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-04-08 18:15:55 +0000
commitefa7a0085d93f6ee10bad7981f7e1953243b4479 (patch)
tree7d840961b9f2d89a7b16c533f6565d413c8d556f
parent09dbce7d1a3a5591d85d061da40c462ee1d2f534 (diff)
downloadpygobject-efa7a0085d93f6ee10bad7981f7e1953243b4479.tar.gz
pygobject-efa7a0085d93f6ee10bad7981f7e1953243b4479.tar.xz
pygobject-efa7a0085d93f6ee10bad7981f7e1953243b4479.zip
Fix a typo Update the tests after the latest "refactoring". The testsuite
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. svn path=/trunk/; revision=770
-rw-r--r--ChangeLog7
-rw-r--r--gobject/option.py4
-rw-r--r--tests/test_option.py7
3 files changed, 16 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 784adb0..31c504f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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