Commit 913ba633 authored by Luke Macken's avatar Luke Macken

Merge pull request #30 from ralphbean/feature/context-manager

Fix the context manager unit tests on py2.4
parents 0ccacedf f603862d
......@@ -17,7 +17,7 @@
import os
import sys
import unittest
import unittest2
import subprocess
import pyrasite
......@@ -26,7 +26,7 @@ from pyrasite.tests.utils import generate_program, run_program, stop_program, \
interpreters
class TestCodeInjection(unittest.TestCase):
class TestCodeInjection(unittest2.TestCase):
def assert_output_contains(self, stdout, stderr, text):
assert text in str(stdout), \
......@@ -83,4 +83,4 @@ class TestCodeInjection(unittest.TestCase):
os.unlink(program)
if __name__ == '__main__':
unittest.main()
unittest2.main()
......@@ -17,13 +17,13 @@
import os
import sys
import unittest
import unittest2
import pyrasite
from pyrasite.tests.utils import run_program, generate_program, stop_program
class TestIPCContextManager(unittest.TestCase):
class TestIPCContextManager(unittest2.TestCase):
def setUp(self):
self.prog = generate_program()
......@@ -43,11 +43,11 @@ class TestIPCContextManager(unittest.TestCase):
# Otherwise import a module which contains modern syntax.
# It really contains our test case, but we have pushed it out into
# another module so that python 2.4 never sees it.
import context_manager_case
context_manager_case.context_manager_business(self)
import pyrasite.tests.context_manager_case
pyrasite.tests.context_manager_case.context_manager_business(self)
class TestIPC(unittest.TestCase):
class TestIPC(unittest2.TestCase):
def setUp(self):
self.prog = generate_program()
......@@ -94,4 +94,4 @@ class TestIPC(unittest.TestCase):
if __name__ == '__main__':
unittest.main()
unittest2.main()
......@@ -23,6 +23,12 @@ elif sys.version_info[0] == 2:
if sys.version_info[1] < 7:
requirements.append('argparse')
tests_require = ['nose']
if sys.version_info[0] == 3:
tests_require.append('unittest2py3k')
else:
tests_require.append('unittest2')
setup(name='pyrasite',
version=version,
description="Inject code into a running Python process",
......@@ -36,7 +42,7 @@ setup(name='pyrasite',
include_package_data=True,
zip_safe=False,
install_requires=requirements,
tests_require=['nose'],
tests_require=tests_require,
test_suite='nose.collector',
entry_points="""
[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