WbRepresentationTestCase
contains no test methods 49 return None # pragma: no cover
50
51
52class WbRepresentationTestCase(WikidataTestCase): 53
54 """Test methods inherited or extended from _WbRepresentation."""
55
FakeWin32UncolorizedTest
contains no test methods511 self.ui_obj.stdout.isatty = lambda: self.expect_color
512
513
514class FakeWin32UncolorizedTest(FakeWin32Test):515
516 """Test case to allow doing uncolorized Win32 tests in any environment."""
517
FakeWin32Test
contains no test methods493 ui_class = terminal_interface_unix.UnixUI
494
495
496class FakeWin32Test(FakeUIColorizedTestBase, FakeUITest):497
498 """
499 Test case to allow doing colorized Win32 tests in any environment.
FakeUnixTest
contains no test methods486 sum(e[1] for e in self._colors[:self._index]))
487
488
489class FakeUnixTest(FakeUIColorizedTestBase, FakeUITest):490
491 """Test case to allow doing colorized Unix tests in any environment."""
492
FakeUIColorizedTestBase
contains no test methods456 self.assertEqual(f.getvalue(), self.expected + '\n')
457
458
459class FakeUIColorizedTestBase(TestCase):460
461 """Base class for test cases requiring that colorized output is active."""
462
Test methods should always start with the test
. If there are no such methods,
the class overriding unittest.TestCase
won't run any test.
Not preferred:
import unittest
def Tests(unittest.TestCase):
def my_test(self, arg1, arg2):
self.assertEquals(arg1, arg2)
Preferred:
import unittest
def Tests(unittest.TestCase):
def test_something(self, arg1, arg2):
self.assertEquals(arg1, arg2)