diff options
author | Amadeusz Piotr Żołnowski <aidecoe@gentoo.org> | 2013-07-18 19:33:31 +0000 |
---|---|---|
committer | Amadeusz Piotr Żołnowski <aidecoe@gentoo.org> | 2013-07-18 19:33:31 +0000 |
commit | e36481f466b630954ef17150920f09800dde1923 (patch) | |
tree | 14f57ce78b866e022a55d256badc152e995771dc /dev-python/pyro | |
parent | add virtual/service-manager for bug #409385 (diff) | |
download | gentoo-2-e36481f466b630954ef17150920f09800dde1923.tar.gz gentoo-2-e36481f466b630954ef17150920f09800dde1923.tar.bz2 gentoo-2-e36481f466b630954ef17150920f09800dde1923.zip |
Fixed tests for Python 2.6 and 3.1.
(Portage version: 2.1.12.11/cvs/Linux x86_64, signed Manifest commit with key F0134531E1DBFAB5)
Diffstat (limited to 'dev-python/pyro')
-rw-r--r-- | dev-python/pyro/ChangeLog | 6 | ||||
-rw-r--r-- | dev-python/pyro/files/4.20-0001-Use-unittest2-for-older-Python-version.patch | 354 | ||||
-rw-r--r-- | dev-python/pyro/pyro-4.20.ebuild | 8 |
3 files changed, 366 insertions, 2 deletions
diff --git a/dev-python/pyro/ChangeLog b/dev-python/pyro/ChangeLog index ee8b5e6ae6d7..a893bbe9f20b 100644 --- a/dev-python/pyro/ChangeLog +++ b/dev-python/pyro/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for dev-python/pyro # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/pyro/ChangeLog,v 1.86 2013/07/10 14:30:15 idella4 Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/pyro/ChangeLog,v 1.87 2013/07/18 19:33:31 aidecoe Exp $ + + 18 Jul 2013; Amadeusz Żołnowski <aidecoe@gentoo.org> pyro-4.20.ebuild, + +files/4.20-0001-Use-unittest2-for-older-Python-version.patch: + Fixed tests for Python 2.6 and 3.1. *pyro-4.20 (10 Jul 2013) diff --git a/dev-python/pyro/files/4.20-0001-Use-unittest2-for-older-Python-version.patch b/dev-python/pyro/files/4.20-0001-Use-unittest2-for-older-Python-version.patch new file mode 100644 index 000000000000..554ea01321a6 --- /dev/null +++ b/dev-python/pyro/files/4.20-0001-Use-unittest2-for-older-Python-version.patch @@ -0,0 +1,354 @@ +From d27de91579bd64397a9554b6c6a2257f098dbaad Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name> +Date: Thu, 18 Jul 2013 20:19:03 +0200 +Subject: [PATCH] Use unittest2 for older Python versions. + +--- + tests/PyroTests/test_core.py | 6 +++++- + tests/PyroTests/test_daemon.py | 7 ++++++- + tests/PyroTests/test_echoserver.py | 7 ++++++- + tests/PyroTests/test_flame.py | 7 ++++++- + tests/PyroTests/test_ironpython.py | 6 +++++- + tests/PyroTests/test_naming.py | 7 ++++++- + tests/PyroTests/test_naming2.py | 6 +++++- + tests/PyroTests/test_package.py | 7 ++++++- + tests/PyroTests/test_serialize.py | 6 +++++- + tests/PyroTests/test_server.py | 6 +++++- + tests/PyroTests/test_server_timeout.py | 7 ++++++- + tests/PyroTests/test_socket.py | 6 +++++- + tests/PyroTests/test_tpjobqueue.py | 7 ++++++- + tests/PyroTests/test_util.py | 7 +++++-- + 14 files changed, 77 insertions(+), 15 deletions(-) + +diff --git a/tests/PyroTests/test_core.py b/tests/PyroTests/test_core.py +index cbcbded..a0b801f 100644 +--- a/tests/PyroTests/test_core.py ++++ b/tests/PyroTests/test_core.py +@@ -5,7 +5,6 @@ Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). + """
+
+ from __future__ import with_statement
+-import unittest
+ import copy
+ import logging
+ import os, sys, time
+@@ -17,6 +16,11 @@ import Pyro4.constants + import Pyro4.futures
+ from testsupport import *
+
++if (sys.version_info >= (2, 7) and sys.version_info < (3, 0)) or \
++ (sys.version_info >= (3, 1)):
++ import unittest
++else:
++ import unittest2 as unittest
+
+ if sys.version_info>=(3,0):
+ import imp
+diff --git a/tests/PyroTests/test_daemon.py b/tests/PyroTests/test_daemon.py +index cf7c06e..05472fd 100644 +--- a/tests/PyroTests/test_daemon.py ++++ b/tests/PyroTests/test_daemon.py +@@ -5,14 +5,19 @@ Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). + """
+
+ from __future__ import with_statement
++import sys
+ import os, time, socket
+-import unittest
+ import Pyro4.core
+ import Pyro4.constants
+ import Pyro4.socketutil
+ from Pyro4.errors import DaemonError,PyroError
+ from testsupport import *
+
++if (sys.version_info >= (2, 7) and sys.version_info < (3, 0)) or \
++ (sys.version_info >= (3, 1)):
++ import unittest
++else:
++ import unittest2 as unittest
+
+ class MyObj(object):
+ def __init__(self, arg):
+diff --git a/tests/PyroTests/test_echoserver.py b/tests/PyroTests/test_echoserver.py +index abca795..5e58e24 100644 +--- a/tests/PyroTests/test_echoserver.py ++++ b/tests/PyroTests/test_echoserver.py +@@ -4,13 +4,18 @@ Tests for the built-in test echo server. + Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
+ """
+
+-import unittest
++import sys
+ import time
+ import Pyro4.test.echoserver as echoserver
+ import Pyro4
+ from threading import Thread,Event
+ from testsupport import *
+
++if (sys.version_info >= (2, 7) and sys.version_info < (3, 0)) or \
++ (sys.version_info >= (3, 1)):
++ import unittest
++else:
++ import unittest2 as unittest
+
+ class EchoServerThread(Thread):
+ def __init__(self):
+diff --git a/tests/PyroTests/test_flame.py b/tests/PyroTests/test_flame.py +index 2406bae..fdc611f 100644 +--- a/tests/PyroTests/test_flame.py ++++ b/tests/PyroTests/test_flame.py +@@ -5,12 +5,17 @@ Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). + """
+
+ from __future__ import with_statement
+-import unittest
+ import Pyro4.utils.flame
+ import Pyro4.utils.flameserver
+ import Pyro4.errors
++import sys
+ from testsupport import *
+
++if (sys.version_info >= (2, 7) and sys.version_info < (3, 0)) or \
++ (sys.version_info >= (3, 1)):
++ import unittest
++else:
++ import unittest2 as unittest
+
+ class FlameDisabledTests(unittest.TestCase):
+ def testFlameDisabled(self):
+diff --git a/tests/PyroTests/test_ironpython.py b/tests/PyroTests/test_ironpython.py +index 70dff4f..8343729 100644 +--- a/tests/PyroTests/test_ironpython.py ++++ b/tests/PyroTests/test_ironpython.py +@@ -4,10 +4,14 @@ Tests for some Ironpython peculiarities. + Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
+ """
+
+-import unittest
+ import sys
+ import pickle
+
++if (sys.version_info >= (2, 7) and sys.version_info < (3, 0)) or \
++ (sys.version_info >= (3, 1)):
++ import unittest
++else:
++ import unittest2 as unittest
+
+ if sys.platform=="cli":
+
+diff --git a/tests/PyroTests/test_naming.py b/tests/PyroTests/test_naming.py +index d61fa99..fb5b580 100644 +--- a/tests/PyroTests/test_naming.py ++++ b/tests/PyroTests/test_naming.py +@@ -5,7 +5,7 @@ Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). + """
+
+ from __future__ import with_statement
+-import unittest
++import sys
+ import time
+ import Pyro4.core
+ import Pyro4.naming
+@@ -15,6 +15,11 @@ from Pyro4.errors import NamingError + from Pyro4 import threadutil
+ from testsupport import *
+
++if (sys.version_info >= (2, 7) and sys.version_info < (3, 0)) or \
++ (sys.version_info >= (3, 1)):
++ import unittest
++else:
++ import unittest2 as unittest
+
+ class NSLoopThread(threadutil.Thread):
+ def __init__(self, nameserver):
+diff --git a/tests/PyroTests/test_naming2.py b/tests/PyroTests/test_naming2.py +index afa0b22..ae398ac 100644 +--- a/tests/PyroTests/test_naming2.py ++++ b/tests/PyroTests/test_naming2.py +@@ -5,7 +5,6 @@ Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). + """
+
+ from __future__ import with_statement
+-import unittest
+ import sys, select, os
+ import Pyro4.core
+ import Pyro4.naming
+@@ -15,6 +14,11 @@ import Pyro4.socketutil + from Pyro4.errors import NamingError,PyroError
+ from testsupport import *
+
++if (sys.version_info >= (2, 7) and sys.version_info < (3, 0)) or \
++ (sys.version_info >= (3, 1)):
++ import unittest
++else:
++ import unittest2 as unittest
+
+ class OfflineNameServerTests(unittest.TestCase):
+ def setUp(self):
+diff --git a/tests/PyroTests/test_package.py b/tests/PyroTests/test_package.py +index 9ab3bba..052eebf 100644 +--- a/tests/PyroTests/test_package.py ++++ b/tests/PyroTests/test_package.py +@@ -4,7 +4,6 @@ Tests for the package structure and import names. + Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
+ """
+
+-import unittest
+ import Pyro4
+ import Pyro4.constants
+ import Pyro4.core
+@@ -14,7 +13,13 @@ import Pyro4.nsc + import Pyro4.socketutil
+ import Pyro4.threadutil
+ import Pyro4.util
++import sys
+
++if (sys.version_info >= (2, 7) and sys.version_info < (3, 0)) or \
++ (sys.version_info >= (3, 1)):
++ import unittest
++else:
++ import unittest2 as unittest
+
+ class TestPackage(unittest.TestCase):
+ def testPyro4(self):
+diff --git a/tests/PyroTests/test_serialize.py b/tests/PyroTests/test_serialize.py +index 4fea39c..f05c84a 100644 +--- a/tests/PyroTests/test_serialize.py ++++ b/tests/PyroTests/test_serialize.py +@@ -5,7 +5,6 @@ Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). + """
+
+ from __future__ import with_statement
+-import unittest
+ import sys
+ import pprint
+ import Pyro4.util
+@@ -13,6 +12,11 @@ import Pyro4.errors + import Pyro4.core
+ from testsupport import *
+
++if (sys.version_info >= (2, 7) and sys.version_info < (3, 0)) or \
++ (sys.version_info >= (3, 1)):
++ import unittest
++else:
++ import unittest2 as unittest
+
+ class SerializeTests_pickle(unittest.TestCase):
+ SERIALIZER="pickle"
+diff --git a/tests/PyroTests/test_server.py b/tests/PyroTests/test_server.py +index d1ebfcc..b2dd661 100644 +--- a/tests/PyroTests/test_server.py ++++ b/tests/PyroTests/test_server.py +@@ -5,7 +5,6 @@ Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). + """
+
+ from __future__ import with_statement
+-import unittest
+ import Pyro4.core
+ import Pyro4.errors
+ import Pyro4.util
+@@ -13,6 +12,11 @@ import time, os, sys, platform + from Pyro4 import threadutil
+ from testsupport import *
+
++if (sys.version_info >= (2, 7) and sys.version_info < (3, 0)) or \
++ (sys.version_info >= (3, 1)):
++ import unittest
++else:
++ import unittest2 as unittest
+
+ class MyThing(object):
+ def __init__(self):
+diff --git a/tests/PyroTests/test_server_timeout.py b/tests/PyroTests/test_server_timeout.py +index daa5a8d..dd5ee34 100644 +--- a/tests/PyroTests/test_server_timeout.py ++++ b/tests/PyroTests/test_server_timeout.py +@@ -4,10 +4,15 @@ Tests for a running Pyro server, with timeouts. + Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
+ """
+
+-import unittest
++import sys
+ import os
+ import test_server
+
++if (sys.version_info >= (2, 7) and sys.version_info < (3, 0)) or \
++ (sys.version_info >= (3, 1)):
++ import unittest
++else:
++ import unittest2 as unittest
+
+ class ServerTestsThreadTimeout(test_server.ServerTestsThreadNoTimeout):
+ SERVERTYPE="thread"
+diff --git a/tests/PyroTests/test_socket.py b/tests/PyroTests/test_socket.py +index 4d44139..b487686 100644 +--- a/tests/PyroTests/test_socket.py ++++ b/tests/PyroTests/test_socket.py +@@ -4,7 +4,6 @@ Tests for the low level socket functions. + Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
+ """
+
+-import unittest
+ import socket, os, sys
+ import Pyro4.socketutil as SU
+ from Pyro4 import threadutil
+@@ -13,6 +12,11 @@ from Pyro4.socketserver.threadpoolserver import SocketServer_Threadpool + import Pyro4
+ from testsupport import *
+
++if (sys.version_info >= (2, 7) and sys.version_info < (3, 0)) or \
++ (sys.version_info >= (3, 1)):
++ import unittest
++else:
++ import unittest2 as unittest
+
+ # determine ipv6 capability
+ has_ipv6 = socket.has_ipv6
+diff --git a/tests/PyroTests/test_tpjobqueue.py b/tests/PyroTests/test_tpjobqueue.py +index 8ab7f7b..7cdc3bb 100644 +--- a/tests/PyroTests/test_tpjobqueue.py ++++ b/tests/PyroTests/test_tpjobqueue.py +@@ -5,12 +5,17 @@ Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). + """
+
+ from __future__ import with_statement
+-import unittest
++import sys
+ import time
+ import random
+ from Pyro4.tpjobqueue import ThreadPooledJobQueue, JobQueueError
+ import Pyro4.threadutil
+
++if (sys.version_info >= (2, 7) and sys.version_info < (3, 0)) or \
++ (sys.version_info >= (3, 1)):
++ import unittest
++else:
++ import unittest2 as unittest
+
+ MIN_POOL_SIZE = 5
+ MAX_POOL_SIZE = 10
+diff --git a/tests/PyroTests/test_util.py b/tests/PyroTests/test_util.py +index ac1e639..497ec4a 100644 +--- a/tests/PyroTests/test_util.py ++++ b/tests/PyroTests/test_util.py +@@ -4,12 +4,15 @@ Tests for the utility functions. + Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
+ """
+
+-import unittest
+-
+ import sys, imp, os, platform
+ import Pyro4.util
+ from testsupport import *
+
++if (sys.version_info >= (2, 7) and sys.version_info < (3, 0)) or \
++ (sys.version_info >= (3, 1)):
++ import unittest
++else:
++ import unittest2 as unittest
+
+ if not hasattr(imp,"reload"):
+ imp.reload=reload # python 2.5 doesn't have imp.reload
+-- +1.8.2.1 + diff --git a/dev-python/pyro/pyro-4.20.ebuild b/dev-python/pyro/pyro-4.20.ebuild index 64cda8984874..ed7ff14bb6f6 100644 --- a/dev-python/pyro/pyro-4.20.ebuild +++ b/dev-python/pyro/pyro-4.20.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/pyro/pyro-4.20.ebuild,v 1.1 2013/07/10 14:30:15 idella4 Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/pyro/pyro-4.20.ebuild,v 1.2 2013/07/18 19:33:31 aidecoe Exp $ EAPI=5 @@ -27,12 +27,18 @@ DEPEND="${RDEPEND} test? ( dev-python/coverage[${PYTHON_USEDEP}] dev-python/nose[${PYTHON_USEDEP}] + python_targets_python2_6? ( + dev-python/unittest2[python_targets_python2_6] ) + python_targets_python3_1? ( + dev-python/unittest2[python_targets_python3_1] ) )" S="${WORKDIR}/${MY_P}" DISTUTILS_IN_SOURCE_BUILD=1 python_prepare_all() { + epatch "${FILESDIR}/${PV}-0001-Use-unittest2-for-older-Python-version.patch" + sed \ -e '/sys.path.insert/a sys.path.insert(1,"PyroTests")' \ -i tests/run_suite.py || die |