Commit 3d94efe2 authored by Luke Macken's avatar Luke Macken

We only need unittest2 for python < 2.7

parent 75a7b122
......@@ -17,16 +17,15 @@
import os
import sys
import unittest2
import subprocess
import pyrasite
from pyrasite.tests.utils import generate_program, run_program, stop_program, \
interpreters
interpreters, unittest
class TestCodeInjection(unittest2.TestCase):
class TestCodeInjection(unittest.TestCase):
def assert_output_contains(self, stdout, stderr, text):
assert text in str(stdout), \
......@@ -83,4 +82,4 @@ class TestCodeInjection(unittest2.TestCase):
os.unlink(program)
if __name__ == '__main__':
unittest2.main()
unittest.main()
......@@ -17,13 +17,12 @@
import os
import sys
import unittest2
import pyrasite
from pyrasite.tests.utils import run_program, generate_program, stop_program
from pyrasite.tests.utils import run_program, generate_program, stop_program, unittest
class TestIPCContextManager(unittest2.TestCase):
class TestIPCContextManager(unittest.TestCase):
def setUp(self):
self.prog = generate_program()
......@@ -47,7 +46,7 @@ class TestIPCContextManager(unittest2.TestCase):
pyrasite.tests.context_manager_case.context_manager_business(self)
class TestIPC(unittest2.TestCase):
class TestIPC(unittest.TestCase):
def setUp(self):
self.prog = generate_program()
......@@ -94,4 +93,4 @@ class TestIPC(unittest2.TestCase):
if __name__ == '__main__':
unittest2.main()
unittest.main()
......@@ -16,11 +16,17 @@
# Copyright (C) 2011-2012 Red Hat, Inc., Luke Macken <lmacken@redhat.com>
import os
import sys
import glob
import time
import textwrap
import tempfile
import subprocess
import unittest
if sys.version_info[0] == 2:
if sys.version_info[1] < 7:
import unittest2 as unittest
def generate_program(threads=1):
......
......@@ -24,10 +24,9 @@ elif sys.version_info[0] == 2:
requirements.append('argparse')
tests_require = ['nose']
if sys.version_info[0] == 3:
tests_require.append('unittest2py3k')
else:
tests_require.append('unittest2')
if sys.version_info[0] == 2:
if sys.version_info[1] < 7:
tests_require.append('unittest2')
setup(name='pyrasite',
version=version,
......
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