def test_clearSuite(self):
     """
     Calling L{_clearSuite} on a populated L{TestSuite} removes
     all tests.
     """
     suite = unittest.TestSuite()
     suite.addTest(self.TestCase())
     # Double check that the test suite actually has something in it.
     self.assertEqual(1, suite.countTestCases())
     _clearSuite(suite)
     self.assertEqual(0, suite.countTestCases())
Пример #2
0
 def test_clearSuite(self):
     """
     Calling L{_clearSuite} on a populated L{TestSuite} removes
     all tests.
     """
     suite = unittest.TestSuite()
     suite.addTest(self.TestCase())
     # Double check that the test suite actually has something in it.
     self.assertEqual(1, suite.countTestCases())
     _clearSuite(suite)
     self.assertEqual(0, suite.countTestCases())
    def test_clearPyunitSuite(self):
        """
        Calling L{_clearSuite} on a populated standard library
        L{TestSuite} removes all tests.

        This test is important since C{_clearSuite} operates by mutating
        internal variables.
        """
        suite = pyunit.TestSuite()
        suite.addTest(self.TestCase())
        # Double check that the test suite actually has something in it.
        self.assertEqual(1, suite.countTestCases())
        _clearSuite(suite)
        self.assertEqual(0, suite.countTestCases())
Пример #4
0
    def test_clearPyunitSuite(self):
        """
        Calling L{_clearSuite} on a populated standard library
        L{TestSuite} removes all tests.

        This test is important since C{_clearSuite} operates by mutating
        internal variables.
        """
        pyunit = __import__('unittest')
        suite = pyunit.TestSuite()
        suite.addTest(self.TestCase())
        # Double check that the test suite actually has something in it.
        self.assertEqual(1, suite.countTestCases())
        _clearSuite(suite)
        self.assertEqual(0, suite.countTestCases())