def test_wont_implement(self):
   doctests.teststring(
       ERROR_RAISING_TESTS,
       optionflags=doctest.ELLIPSIS,
       wont_implement_ok=True)
   doctests.teststring(
       ERROR_RAISING_TESTS,
       optionflags=doctest.IGNORE_EXCEPTION_DETAIL,
       wont_implement_ok=True)
Beispiel #2
0
    def test_not_implemented(self):
        result = doctests.teststring(NOT_IMPLEMENTED_RAISING_TESTS,
                                     optionflags=doctest.ELLIPSIS,
                                     not_implemented_ok=True)
        self.assertNotEqual(result.attempted, 0)
        self.assertEqual(result.failed, 0)

        result = doctests.teststring(
            NOT_IMPLEMENTED_RAISING_TESTS,
            optionflags=doctest.IGNORE_EXCEPTION_DETAIL,
            not_implemented_ok=True)
        self.assertNotEqual(result.attempted, 0)
        self.assertEqual(result.failed, 0)
 def test_wont_implement_followed_by_name_error(self):
   result = doctests.teststring(
       ERROR_RAISING_NAME_ERROR_TESTS,
       optionflags=doctest.ELLIPSIS,
       wont_implement_ok=True)
   self.assertEqual(result.attempted, 6)
   self.assertEqual(result.failed, 1)  # Only the very last one.
Beispiel #4
0
 def test_failure(self):
     result = doctests.teststring(SAMPLE_DOCTEST.replace(
         '25.0', '25.00001'),
                                  report=False)
     self.assertEqual(result.attempted, 3)
     self.assertEqual(result.failed, 1)
Beispiel #5
0
 def test_good(self):
     result = doctests.teststring(SAMPLE_DOCTEST, report=False)
     self.assertEqual(result.attempted, 3)
     self.assertEqual(result.failed, 0)
Beispiel #6
0
 def test_uses_beam_dataframes(self):
     result = doctests.teststring(CHECK_USES_DEFERRED_DATAFRAMES,
                                  report=False)
     self.assertNotEqual(result.attempted, 0)
     self.assertEqual(result.failed, 0)
Beispiel #7
0
 def test_failed_assignment(self):
     result = doctests.teststring(FAILED_ASSIGNMENT,
                                  optionflags=doctest.ELLIPSIS,
                                  not_implemented_ok=True)
     self.assertNotEqual(result.attempted, 0)
     self.assertEqual(result.failed, 0)