[pygobject] tests: Stop using assertSequenceEqual()
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] tests: Stop using assertSequenceEqual()
- Date: Mon, 14 Jan 2013 06:42:39 +0000 (UTC)
commit dc0dafd1f6ca3ebbf04210768a45587387e44551
Author: Martin Pitt <martinpitt gnome org>
Date: Mon Jan 14 07:34:46 2013 +0100
tests: Stop using assertSequenceEqual()
assertSequenceEqual() does not yet exist in Python 2.6, and is not necessary
either as assertEqual() on sequences automatically does list comparison.
Part of https://bugzilla.gnome.org/show_bug.cgi?id=691646
tests/test_gtype.py | 6 ++----
tests/test_signal.py | 6 ++----
2 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/tests/test_gtype.py b/tests/test_gtype.py
index dec716e..8099101 100644
--- a/tests/test_gtype.py
+++ b/tests/test_gtype.py
@@ -37,15 +37,13 @@ class TestTypeModuleLevelFunctions(unittest.TestCase):
self.assertRaises(TypeError, GObject.type_is_a, 1, 2)
def test_type_children(self):
- self.assertSequenceEqual(GObject.type_children(CustomBase),
- [CustomChild.__gtype__])
+ self.assertEqual(GObject.type_children(CustomBase), [CustomChild.__gtype__])
self.assertEqual(len(GObject.type_children(CustomChild)), 0)
def test_type_interfaces(self):
self.assertEqual(len(GObject.type_interfaces(CustomBase)), 0)
self.assertEqual(len(GObject.type_interfaces(CustomChild)), 1)
- self.assertSequenceEqual(GObject.type_interfaces(CustomChild),
- [GIMarshallingTests.Interface.__gtype__])
+ self.assertEqual(GObject.type_interfaces(CustomChild), [GIMarshallingTests.Interface.__gtype__])
def test_type_parent(self):
self.assertEqual(GObject.type_parent(CustomChild), CustomBase.__gtype__)
diff --git a/tests/test_signal.py b/tests/test_signal.py
index fc8c835..723e411 100644
--- a/tests/test_signal.py
+++ b/tests/test_signal.py
@@ -794,11 +794,9 @@ class TestSignalModuleLevelFunctions(unittest.TestCase):
my_signal_expected_query_result = [my_signal_id, 'my-signal', C.__gtype__,
1, GObject.TYPE_NONE, (GObject.TYPE_INT,)]
# signal_query(name, type)
- self.assertSequenceEqual(GObject.signal_query('my-signal', C),
- my_signal_expected_query_result)
+ self.assertEqual(list(GObject.signal_query('my-signal', C)), my_signal_expected_query_result)
# signal_query(signal_id)
- self.assertSequenceEqual(GObject.signal_query(my_signal_id),
- my_signal_expected_query_result)
+ self.assertEqual(list(GObject.signal_query(my_signal_id)), my_signal_expected_query_result)
# invalid query returns None instead of raising
self.assertEqual(GObject.signal_query(0), None)
self.assertEqual(GObject.signal_query('NOT_A_SIGNAL', C),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]