Skip to content

Commit 23e07c4

Browse files
committed
Worked around some 2.7+ only unittest-isms from test_repl.
1 parent d4b1e81 commit 23e07c4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bpython/test/test_repl.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
import unittest
33
from itertools import islice
44
from mock import Mock
5+
try:
6+
from unittest import skip
7+
except ImportError:
8+
def skip(f):
9+
return lambda self: None
10+
511
from bpython import config, repl, cli, autocomplete
612

713
def setup_config(conf):
@@ -239,7 +245,7 @@ def test_current_string(self):
239245
self.assertEqual(self.repl.current_string(), '')
240246

241247
# TODO: figure out how to capture whether foobar is in globals
242-
@unittest.skip('not working yet')
248+
@skip('not working yet')
243249
def test_push(self):
244250
self.repl = FakeRepl()
245251
self.repl.push("foobar = 2")
@@ -338,7 +344,7 @@ def test_file_should_not_appear_in_complete(self):
338344
self.repl.current_word = "_"
339345
self.assertTrue(self.repl.complete())
340346
self.assertTrue(hasattr(self.repl.completer,'matches'))
341-
self.assertNotIn('__file__', self.repl.completer.matches)
347+
self.assertTrue('__file__' not in self.repl.completer.matches)
342348

343349

344350
class TestCliRepl(unittest.TestCase):

0 commit comments

Comments
 (0)