| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -631,6 +631,8 @@ def testShortDescriptionWithMultiLineDocstring(self): | |||
| 631 | 631 | 'Tests shortDescription() for a method with a longer ' | |
| 632 | 632 | 'docstring.') | |
| 633 | 633 | ||
| 634 | + @unittest.skipIf(sys.flags.optimize >= 2, | ||
| 635 | + "Docstrings are omitted with -O2 and above") | ||
| 634 | 636 | def testShortDescriptionWhitespaceTrimming(self): | |
| 635 | 637 | """ | |
| 636 | 638 | Tests shortDescription() whitespace is trimmed, so that the first | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,9 +58,9 @@ def removeTest(): | |||
| 58 | 58 | ||
| 59 | 59 | class FooBar(unittest.TestCase): | |
| 60 | 60 | def testPass(self): | |
| 61 | - assert True | ||
| 61 | + pass | ||
| 62 | 62 | def testFail(self): | |
| 63 | - assert False | ||
| 63 | + raise AssertionError | ||
| 64 | 64 | ||
| 65 | 65 | class FooBarLoader(unittest.TestLoader): | |
| 66 | 66 | """Test loader that returns a suite containing FooBar.""" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1875,9 +1875,10 @@ def foo(x=0): | |||
| 1875 | 1875 | self.assertEqual(foo(), 1) | |
| 1876 | 1876 | self.assertEqual(foo(), 0) | |
| 1877 | 1877 | ||
| 1878 | + orig_doc = foo.__doc__ | ||
| 1878 | 1879 | with patch.object(foo, '__doc__', "FUN"): | |
| 1879 | 1880 | self.assertEqual(foo.__doc__, "FUN") | |
| 1880 | - self.assertEqual(foo.__doc__, "TEST") | ||
| 1881 | + self.assertEqual(foo.__doc__, orig_doc) | ||
| 1881 | 1882 | ||
| 1882 | 1883 | with patch.object(foo, '__module__', "testpatch2"): | |
| 1883 | 1884 | self.assertEqual(foo.__module__, "testpatch2") | |
| Back | FazBrowse Home | New Git URL |
0 commit comments