Commit f603862d authored by Ralph Bean's avatar Ralph Bean

Using unittest2 to get skipTest on py2.4.

parent e71ad5cf
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import os import os
import sys import sys
import unittest import unittest2
import subprocess import subprocess
import pyrasite import pyrasite
...@@ -26,7 +26,7 @@ from pyrasite.tests.utils import generate_program, run_program, stop_program, \ ...@@ -26,7 +26,7 @@ from pyrasite.tests.utils import generate_program, run_program, stop_program, \
interpreters interpreters
class TestCodeInjection(unittest.TestCase): class TestCodeInjection(unittest2.TestCase):
def assert_output_contains(self, stdout, stderr, text): def assert_output_contains(self, stdout, stderr, text):
assert text in str(stdout), \ assert text in str(stdout), \
...@@ -83,4 +83,4 @@ class TestCodeInjection(unittest.TestCase): ...@@ -83,4 +83,4 @@ class TestCodeInjection(unittest.TestCase):
os.unlink(program) os.unlink(program)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest2.main()
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
import os import os
import sys import sys
import unittest import unittest2
import pyrasite import pyrasite
from pyrasite.tests.utils import run_program, generate_program, stop_program from pyrasite.tests.utils import run_program, generate_program, stop_program
class TestIPCContextManager(unittest.TestCase): class TestIPCContextManager(unittest2.TestCase):
def setUp(self): def setUp(self):
self.prog = generate_program() self.prog = generate_program()
...@@ -43,11 +43,11 @@ class TestIPCContextManager(unittest.TestCase): ...@@ -43,11 +43,11 @@ class TestIPCContextManager(unittest.TestCase):
# Otherwise import a module which contains modern syntax. # Otherwise import a module which contains modern syntax.
# It really contains our test case, but we have pushed it out into # It really contains our test case, but we have pushed it out into
# another module so that python 2.4 never sees it. # another module so that python 2.4 never sees it.
import context_manager_case import pyrasite.tests.context_manager_case
context_manager_case.context_manager_business(self) pyrasite.tests.context_manager_case.context_manager_business(self)
class TestIPC(unittest.TestCase): class TestIPC(unittest2.TestCase):
def setUp(self): def setUp(self):
self.prog = generate_program() self.prog = generate_program()
...@@ -94,4 +94,4 @@ class TestIPC(unittest.TestCase): ...@@ -94,4 +94,4 @@ class TestIPC(unittest.TestCase):
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest2.main()
...@@ -15,6 +15,12 @@ elif sys.version_info[0] == 2: ...@@ -15,6 +15,12 @@ elif sys.version_info[0] == 2:
if sys.version_info[1] < 7: if sys.version_info[1] < 7:
requirements.append('argparse') requirements.append('argparse')
tests_require = ['nose']
if sys.version_info[0] == 3:
tests_require.append('unittest2py3k')
else:
tests_require.append('unittest2')
setup(name='pyrasite', setup(name='pyrasite',
version=version, version=version,
description="Inject code into a running Python process", description="Inject code into a running Python process",
...@@ -28,7 +34,7 @@ setup(name='pyrasite', ...@@ -28,7 +34,7 @@ setup(name='pyrasite',
include_package_data=True, include_package_data=True,
zip_safe=False, zip_safe=False,
install_requires=requirements, install_requires=requirements,
tests_require=['nose'], tests_require=tests_require,
test_suite='nose.collector', test_suite='nose.collector',
entry_points=""" entry_points="""
[console_scripts] [console_scripts]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment