[shiboken] Backport patch to fix tests with Python 2.7

Kalev Lember kalev at fedoraproject.org
Thu Aug 5 07:11:19 UTC 2010


commit 3d5f5ea7758c2b00e0fbf6f6e82d0125b8310f73
Author: Kalev Lember <kalev at smartlink.ee>
Date:   Thu Aug 5 10:08:58 2010 +0300

    Backport patch to fix tests with Python 2.7

 shiboken-0.4.0-python27.patch |   31 +++++++++++++++++++++++++++++++
 shiboken.spec                 |    5 ++++-
 2 files changed, 35 insertions(+), 1 deletions(-)
---
diff --git a/shiboken-0.4.0-python27.patch b/shiboken-0.4.0-python27.patch
new file mode 100644
index 0000000..e3391dc
--- /dev/null
+++ b/shiboken-0.4.0-python27.patch
@@ -0,0 +1,31 @@
+From 96b70b2d4c22e97dd88924886454e7cfb0172136 Mon Sep 17 00:00:00 2001
+From: Kalev Lember <kalev at smartlink.ee>
+Date: Wed, 4 Aug 2010 14:09:14 +0300
+Subject: [PATCH] Modified one more test to use assert_(not a == b) instead of assertNotEqual
+
+Similar to 83c272, avoid using assertNotEqual which in Python 2.7 uses
+the != operator; that operator however is intentionally left undefined
+in Point class.
+
+Reviewed by Marcelo Lira <marcelo.lira at openbossa.org>
+Reviewed by Renato Araujo <renato.filho at openbossa.org>
+---
+ tests/samplebinding/reference_test.py |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/tests/samplebinding/reference_test.py b/tests/samplebinding/reference_test.py
+index 0c373ff..e754449 100644
+--- a/tests/samplebinding/reference_test.py
++++ b/tests/samplebinding/reference_test.py
+@@ -64,7 +64,7 @@ class ReferenceTest(unittest.TestCase):
+     def testCantSegFaultWhenReceiveNone(self):
+         '''do not segfault when receiving None as argument.'''
+         s = Str()
+-        self.assertNotEqual(None, s)
++        self.assert_(not None == s)
+ 
+     def testMethodThatReceivesConstReference(self):
+         '''Test a method that receives a const reference to an object as argument.'''
+-- 
+1.7.2
+
diff --git a/shiboken.spec b/shiboken.spec
index e4b8a7f..c483094 100644
--- a/shiboken.spec
+++ b/shiboken.spec
@@ -7,6 +7,7 @@ Group:          Development/Tools
 License:        GPLv2
 URL:            http://www.pyside.org
 Source0:        http://www.pyside.org/files/shiboken-%{version}.tar.bz2
+Patch0:         shiboken-0.4.0-python27.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  apiextractor-devel
@@ -60,6 +61,7 @@ developing applications that use %{name}.
 
 %prep
 %setup -q
+%patch0 -p1 -b .python27
 
 # Build against sparsehash package
 rm -rf ext/sparsehash/
@@ -85,7 +87,7 @@ make install DESTDIR=$RPM_BUILD_ROOT -C %{_target_platform}
 
 
 %check
-#make test -C %{_target_platform}
+make test -C %{_target_platform}
 
 
 %clean
@@ -120,6 +122,7 @@ rm -rf $RPM_BUILD_ROOT
 %changelog
 * Wed Aug 04 2010 Kalev Lember <kalev at smartlink.ee> - 0.4.0-1
 - Update to 0.4.0
+- Backport patch to fix tests with Python 2.7
 
 * Mon Aug 02 2010 Kalev Lember <kalev at smartlink.ee> - 0.3.2-6
 - Temporarily disable tests to fix build with Python 2.7


More information about the scm-commits mailing list