| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ python: | |||
| 8 | 8 | ||
| 9 | 9 | install: | |
| 10 | 10 | - "python setup.py install" | |
| 11 | - - "pip install 'curtsies<0.2.0' greenlet pygments requests" | ||
| 11 | + - "pip install 'curtsies<0.2.0' greenlet pygments requests unittest2" | ||
| 12 | 12 | ||
| 13 | 13 | script: | |
| 14 | 14 | - cd build/lib/ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,13 +5,11 @@ | |||
| 5 | 5 | import sys | |
| 6 | 6 | import termios | |
| 7 | 7 | import textwrap | |
| 8 | - import unittest | ||
| 9 | 8 | ||
| 10 | 9 | try: | |
| 11 | - from unittest import skip | ||
| 10 | + import unittest2 as unittest | ||
| 12 | 11 | except ImportError: | |
| 13 | - def skip(f): | ||
| 14 | - return lambda self: None | ||
| 12 | + import unittest | ||
| 15 | 13 | ||
| 16 | 14 | try: | |
| 17 | 15 | from twisted.internet import reactor | |
@@ -103,14 +101,13 @@ def spam(a, (b, c)): | |||
| 103 | 101 | return self.run_bpython(input).addCallback(self.check_no_traceback) | |
| 104 | 102 | ||
| 105 | 103 | def check_no_traceback(self, data): | |
| 106 | - tb = data[data.find("Traceback"):] | ||
| 107 | - self.assertTrue("Traceback" not in data, tb) | ||
| 104 | + self.assertNotIn("Traceback", data) | ||
| 108 | 105 | ||
| 109 | 106 | if reactor is not None: | |
| 110 | 107 | class CursesCrashersTest(TrialTestCase, CrashersTest): | |
| 111 | 108 | backend = "cli" | |
| 112 | 109 | ||
| 113 | - @skip("take 6 seconds, and Simon says we can skip them") | ||
| 110 | + @unittest.skip("take 6 seconds, and Simon says we can skip them") | ||
| 114 | 111 | class UrwidCrashersTest(TrialTestCase, CrashersTest): | |
| 115 | 112 | backend = "urwid" | |
| 116 | 113 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -222,7 +222,7 @@ def setUp(self): | |||
| 222 | 222 | def test_seq(self): | |
| 223 | 223 | f = lambda cursor_offset, line: ('hi', 2) | |
| 224 | 224 | self.edits.add('a', f) | |
| 225 | - self.assertTrue('a' in self.edits) | ||
| 225 | + self.assertIn('a', self.edits) | ||
| 226 | 226 | self.assertEqual(self.edits['a'], f) | |
| 227 | 227 | self.assertEqual(self.edits.call('a', cursor_offset=3, line='hello'), | |
| 228 | 228 | ('hi', 2)) | |
@@ -245,12 +245,12 @@ def test_config(self): | |||
| 245 | 245 | f = lambda cursor_offset, line: ('hi', 2) | |
| 246 | 246 | g = lambda cursor_offset, line: ('hey', 3) | |
| 247 | 247 | self.edits.add_config_attr('att', f) | |
| 248 | - self.assertFalse('att' in self.edits) | ||
| 248 | + self.assertNotIn('att', self.edits) | ||
| 249 | 249 | class config: att = 'c' | |
| 250 | 250 | key_dispatch = {'c': 'c'} | |
| 251 | 251 | configured_edits = self.edits.mapping_with_config(config, key_dispatch) | |
| 252 | 252 | self.assertTrue(configured_edits.__contains__, 'c') | |
| 253 | - self.assertFalse('c' in self.edits) | ||
| 253 | + self.assertNotIn('c', self.edits) | ||
| 254 | 254 | self.assertRaises(NotImplementedError, | |
| 255 | 255 | configured_edits.add_config_attr, 'att2', g) | |
| 256 | 256 | self.assertRaises(NotImplementedError, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,15 +3,13 @@ | |||
| 3 | 3 | import os | |
| 4 | 4 | import socket | |
| 5 | 5 | import sys | |
| 6 | - import unittest | ||
| 7 | 6 | ||
| 8 | 7 | from mock import Mock, MagicMock | |
| 9 | 8 | ||
| 10 | 9 | try: | |
| 11 | - from unittest import skip | ||
| 10 | + import unittest2 as unittest | ||
| 12 | 11 | except ImportError: | |
| 13 | - def skip(f): | ||
| 14 | - return lambda self: None | ||
| 12 | + import unittest | ||
| 15 | 13 | ||
| 16 | 14 | py3 = (sys.version_info[0] == 3) | |
| 17 | 15 | ||
@@ -101,7 +99,7 @@ def test_append(self): | |||
| 101 | 99 | ||
| 102 | 100 | self.assertEqual(self.history.back(), 'print "foo\n"') | |
| 103 | 101 | ||
| 104 | - @skip("I don't understand this test") | ||
| 102 | + @unittest.skip("I don't understand this test") | ||
| 105 | 103 | def test_enter(self): | |
| 106 | 104 | self.history.enter('#lastnumber!') | |
| 107 | 105 | ||
@@ -278,7 +276,7 @@ def assert_get_source_error_for_current_function(self, func, msg): | |||
| 278 | 276 | def test_current_function(self): | |
| 279 | 277 | self.set_input_line('INPUTLINE') | |
| 280 | 278 | self.repl.current_func = collections.MutableSet.add | |
| 281 | - self.assertTrue("Add an element." in self.repl.get_source_of_current_name()) | ||
| 279 | + self.assertIn("Add an element.", self.repl.get_source_of_current_name()) | ||
| 282 | 280 | ||
| 283 | 281 | self.assert_get_source_error_for_current_function( | |
| 284 | 282 | collections.defaultdict.copy, "No source code found for INPUTLINE") | |
@@ -295,7 +293,7 @@ def test_current_function(self): | |||
| 295 | 293 | def test_current_line(self): | |
| 296 | 294 | self.repl.interp.locals['a'] = socket.socket | |
| 297 | 295 | self.set_input_line('a') | |
| 298 | - self.assertTrue('dup(self)' in self.repl.get_source_of_current_name()) | ||
| 296 | + self.assertIn('dup(self)', self.repl.get_source_of_current_name()) | ||
| 299 | 297 | ||
| 300 | 298 | #TODO add tests for various failures without using current function | |
| 301 | 299 | ||
@@ -334,7 +332,7 @@ def test_simple_global_complete(self): | |||
| 334 | 332 | self.assertEqual(self.repl.matches_iter.matches, | |
| 335 | 333 | ['def', 'del', 'delattr(', 'dict(', 'dir(', 'divmod(']) | |
| 336 | 334 | ||
| 337 | - @skip("disabled while non-simple completion is disabled") | ||
| 335 | + @unittest.skip("disabled while non-simple completion is disabled") | ||
| 338 | 336 | def test_substring_global_complete(self): | |
| 339 | 337 | self.repl = FakeRepl({'autocomplete_mode': autocomplete.SUBSTRING}) | |
| 340 | 338 | self.setInputLine("time") | |
@@ -344,7 +342,7 @@ def test_substring_global_complete(self): | |||
| 344 | 342 | self.assertEqual(self.repl.completer.matches, | |
| 345 | 343 | ['RuntimeError(', 'RuntimeWarning(']) | |
| 346 | 344 | ||
| 347 | - @skip("disabled while non-simple completion is disabled") | ||
| 345 | + @unittest.skip("disabled while non-simple completion is disabled") | ||
| 348 | 346 | def test_fuzzy_global_complete(self): | |
| 349 | 347 | self.repl = FakeRepl({'autocomplete_mode': autocomplete.FUZZY}) | |
| 350 | 348 | self.setInputLine("doc") | |
@@ -368,7 +366,7 @@ def test_simple_attribute_complete(self): | |||
| 368 | 366 | self.assertEqual(self.repl.matches_iter.matches, | |
| 369 | 367 | ['Foo.bar']) | |
| 370 | 368 | ||
| 371 | - @skip("disabled while non-simple completion is disabled") | ||
| 369 | + @unittest.skip("disabled while non-simple completion is disabled") | ||
| 372 | 370 | def test_substring_attribute_complete(self): | |
| 373 | 371 | self.repl = FakeRepl({'autocomplete_mode': autocomplete.SUBSTRING}) | |
| 374 | 372 | self.setInputLine("Foo.az") | |
@@ -382,7 +380,7 @@ def test_substring_attribute_complete(self): | |||
| 382 | 380 | self.assertEqual(self.repl.completer.matches, | |
| 383 | 381 | ['Foo.baz']) | |
| 384 | 382 | ||
| 385 | - @skip("disabled while non-simple completion is disabled") | ||
| 383 | + @unittest.skip("disabled while non-simple completion is disabled") | ||
| 386 | 384 | def test_fuzzy_attribute_complete(self): | |
| 387 | 385 | self.repl = FakeRepl({'autocomplete_mode': autocomplete.FUZZY}) | |
| 388 | 386 | self.setInputLine("Foo.br") | |
@@ -412,7 +410,7 @@ def test_file_should_not_appear_in_complete(self): | |||
| 412 | 410 | self.setInputLine("_") | |
| 413 | 411 | self.assertTrue(self.repl.complete()) | |
| 414 | 412 | self.assertTrue(hasattr(self.repl.matches_iter,'matches')) | |
| 415 | - self.assertTrue('__file__' not in self.repl.matches_iter.matches) | ||
| 413 | + self.assertNotIn('__file__', self.repl.matches_iter.matches) | ||
| 416 | 414 | ||
| 417 | 415 | ||
| 418 | 416 | class TestCliRepl(unittest.TestCase): | |
@@ -465,7 +463,7 @@ def test_simple_tab_complete(self): | |||
| 465 | 463 | self.repl.complete.assert_called_with(tab=True) | |
| 466 | 464 | self.assertEqual(self.repl.s, "foobar") | |
| 467 | 465 | ||
| 468 | - @skip("disabled while non-simple completion is disabled") | ||
| 466 | + @unittest.skip("disabled while non-simple completion is disabled") | ||
| 469 | 467 | def test_substring_tab_complete(self): | |
| 470 | 468 | self.repl.s = "bar" | |
| 471 | 469 | self.repl.config.autocomplete_mode = autocomplete.FUZZY | |
@@ -474,7 +472,7 @@ def test_substring_tab_complete(self): | |||
| 474 | 472 | self.repl.tab() | |
| 475 | 473 | self.assertEqual(self.repl.s, "foofoobar") | |
| 476 | 474 | ||
| 477 | - @skip("disabled while non-simple completion is disabled") | ||
| 475 | + @unittest.skip("disabled while non-simple completion is disabled") | ||
| 478 | 476 | def test_fuzzy_tab_complete(self): | |
| 479 | 477 | self.repl.s = "br" | |
| 480 | 478 | self.repl.config.autocomplete_mode = autocomplete.FUZZY | |
@@ -509,7 +507,7 @@ def test_back_parameter(self): | |||
| 509 | 507 | self.assertTrue(self.repl.s, "previtem") | |
| 510 | 508 | ||
| 511 | 509 | # Attribute Tests | |
| 512 | - @skip("disabled while non-simple completion is disabled") | ||
| 510 | + @unittest.skip("disabled while non-simple completion is disabled") | ||
| 513 | 511 | def test_fuzzy_attribute_tab_complete(self): | |
| 514 | 512 | """Test fuzzy attribute with no text""" | |
| 515 | 513 | self.repl.s = "Foo." | |
@@ -518,7 +516,7 @@ def test_fuzzy_attribute_tab_complete(self): | |||
| 518 | 516 | self.repl.tab() | |
| 519 | 517 | self.assertEqual(self.repl.s, "Foo.foobar") | |
| 520 | 518 | ||
| 521 | - @skip("disabled while non-simple completion is disabled") | ||
| 519 | + @unittest.skip("disabled while non-simple completion is disabled") | ||
| 522 | 520 | def test_fuzzy_attribute_tab_complete2(self): | |
| 523 | 521 | """Test fuzzy attribute with some text""" | |
| 524 | 522 | self.repl.s = "Foo.br" | |
@@ -538,14 +536,14 @@ def test_simple_expand(self): | |||
| 538 | 536 | self.repl.tab() | |
| 539 | 537 | self.assertEqual(self.repl.s, "foo") | |
| 540 | 538 | ||
| 541 | - @skip("disabled while non-simple completion is disabled") | ||
| 539 | + @unittest.skip("disabled while non-simple completion is disabled") | ||
| 542 | 540 | def test_substring_expand_forward(self): | |
| 543 | 541 | self.repl.config.autocomplete_mode = autocomplete.SUBSTRING | |
| 544 | 542 | self.repl.s = "ba" | |
| 545 | 543 | self.repl.tab() | |
| 546 | 544 | self.assertEqual(self.repl.s, "bar") | |
| 547 | 545 | ||
| 548 | - @skip("disabled while non-simple completion is disabled") | ||
| 546 | + @unittest.skip("disabled while non-simple completion is disabled") | ||
| 549 | 547 | def test_fuzzy_expand(self): | |
| 550 | 548 | pass | |
| 551 | 549 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -183,7 +183,7 @@ def initialize_options(self): | |||
| 183 | 183 | 'requests' | |
| 184 | 184 | ], | |
| 185 | 185 | extras_require = extras_require, | |
| 186 | - tests_require = ['mock'], | ||
| 186 | + tests_require = ['mock', 'unittest2'], | ||
| 187 | 187 | packages = packages, | |
| 188 | 188 | data_files = data_files, | |
| 189 | 189 | package_data = { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments