Skip to content

Commit bf9550c

Browse files
committed
Only use English translations for tests
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent b85f0b8 commit bf9550c

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

bpython/test/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
try:
2+
import unittest2 as unittest
3+
except ImportError:
4+
import unittest
5+
6+
from bpython.translations import init
7+
8+
class FixLanguageTestCase(unittest.TestCase):
9+
10+
@classmethod
11+
def setUpClass(cls):
12+
init(languages=['en'])

bpython/test/test_curtsies_painting.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818
from bpython.curtsiesfrontend import replpainter
1919
from bpython.repl import History
2020
from bpython.curtsiesfrontend.repl import INCONSISTENT_HISTORY_MSG, CONTIGUITY_BROKEN_MSG
21+
from bpython.test import FixLanguageTestCase as TestCase
2122

2223
def setup_config():
2324
config_struct = config.Struct()
2425
config.loadini(config_struct, os.devnull)
2526
return config_struct
2627

27-
class TestCurtsiesPainting(FormatStringTest):
28+
class TestCurtsiesPainting(FormatStringTest, TestCase):
2829
def setUp(self):
2930
self.repl = Repl(config=setup_config())
3031
self.repl.rl_history = History() # clear history

bpython/test/test_curtsies_repl.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from bpython import config
1919
from bpython import args
2020
from bpython._py3compat import py3
21+
from bpython.test import FixLanguageTestCase as TestCase
2122

2223
def setup_config(conf):
2324
config_struct = config.Struct()
@@ -29,7 +30,7 @@ def setup_config(conf):
2930
return config_struct
3031

3132

32-
class TestCurtsiesRepl(unittest.TestCase):
33+
class TestCurtsiesRepl(TestCase):
3334

3435
def setUp(self):
3536
self.repl = create_repl()
@@ -88,7 +89,7 @@ def mock_next(obj, return_value):
8889
else:
8990
obj.next.return_value = return_value
9091

91-
class TestCurtsiesReplTab(unittest.TestCase):
92+
class TestCurtsiesReplTab(TestCase):
9293

9394
def setUp(self):
9495
self.repl = create_repl()
@@ -153,7 +154,7 @@ def test_tab_completes_common_sequence(self):
153154
self.repl.matches_iter.substitute_cseq.assert_called_once_with()
154155

155156

156-
class TestCurtsiesReplFilenameCompletion(unittest.TestCase):
157+
class TestCurtsiesReplFilenameCompletion(TestCase):
157158
def setUp(self):
158159
self.repl = create_repl()
159160

@@ -213,7 +214,7 @@ def create_repl(**kwargs):
213214
repl.height = 20
214215
return repl
215216

216-
class TestFutureImports(unittest.TestCase):
217+
class TestFutureImports(TestCase):
217218

218219
def test_repl(self):
219220
repl = create_repl()
@@ -236,7 +237,7 @@ def test_interactive(self):
236237

237238
self.assertEqual(out.getvalue(), '0.5\n0.5\n')
238239

239-
class TestPredictedIndent(unittest.TestCase):
240+
class TestPredictedIndent(TestCase):
240241
def setUp(self):
241242
self.repl = create_repl()
242243

@@ -253,7 +254,7 @@ def test_complex(self):
253254
self.assertEqual(self.repl.predicted_indent('reduce(asdfasdf,'), 7)
254255

255256

256-
class TestCurtsiesReevaluate(unittest.TestCase):
257+
class TestCurtsiesReevaluate(TestCase):
257258
def setUp(self):
258259
self.repl = create_repl()
259260

@@ -264,7 +265,7 @@ def test_variable_is_cleared(self):
264265
self.repl.undo()
265266
self.assertNotIn('b', self.repl.interp.locals)
266267

267-
class TestCurtsiesPagerText(unittest.TestCase):
268+
class TestCurtsiesPagerText(TestCase):
268269

269270
def setUp(self):
270271
self.repl = create_repl()

0 commit comments

Comments
 (0)