Skip to content

Commit 031991b

Browse files
committed
Use unittest2 for Python 2.6
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 5342649 commit 031991b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

bpython/test/test_repl.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import os
2-
import unittest
32
from itertools import islice
43
from mock import Mock
54
try:
6-
from unittest import skip
5+
import unittest2 as unittest
76
except ImportError:
8-
def skip(f):
9-
return lambda self: None
7+
import unittest
108

119
from bpython import config, repl, cli, autocomplete
1210

@@ -245,7 +243,7 @@ def test_current_string(self):
245243
self.assertEqual(self.repl.current_string(), '')
246244

247245
# TODO: figure out how to capture whether foobar is in globals
248-
@skip('not working yet')
246+
@unittest.skip('not working yet')
249247
def test_push(self):
250248
self.repl = FakeRepl()
251249
self.repl.push("foobar = 2")

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ def initialize_options(self):
175175
install_requires.append('ndg-httpsclient')
176176
install_requires.append('pyasn1')
177177

178+
tests_require = ['mock']
179+
if sys.version_info[0] == 2 and sys.version_info[1] < 7:
180+
tests_require.append('unittest2')
181+
178182
# translations
179183
mo_files = list()
180184
for language in os.listdir(translations_dir):
@@ -194,7 +198,7 @@ def initialize_options(self):
194198
interpreter for Unix-like operating systems.""",
195199
install_requires = install_requires,
196200
extras_require = extras_require,
197-
tests_require = ['mock'],
201+
tests_require = tests_require,
198202
packages = packages,
199203
data_files = data_files,
200204
package_data = {

0 commit comments

Comments
 (0)