File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -631,6 +631,8 @@ def testShortDescriptionWithMultiLineDocstring(self):
631631 'Tests shortDescription() for a method with a longer '
632632 'docstring.' )
633633
634+ @unittest .skipIf (sys .flags .optimize >= 2 ,
635+ "Docstrings are omitted with -O2 and above" )
634636 def testShortDescriptionWhitespaceTrimming (self ):
635637 """
636638 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():
5858
5959 class FooBar (unittest .TestCase ):
6060 def testPass (self ):
61- assert True
61+ pass
6262 def testFail (self ):
63- assert False
63+ raise AssertionError
6464
6565 class FooBarLoader (unittest .TestLoader ):
6666 """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):
18751875 self .assertEqual (foo (), 1 )
18761876 self .assertEqual (foo (), 0 )
18771877
1878+ orig_doc = foo .__doc__
18781879 with patch .object (foo , '__doc__' , "FUN" ):
18791880 self .assertEqual (foo .__doc__ , "FUN" )
1880- self .assertEqual (foo .__doc__ , "TEST" )
1881+ self .assertEqual (foo .__doc__ , orig_doc )
18811882
18821883 with patch .object (foo , '__module__' , "testpatch2" ):
18831884 self .assertEqual (foo .__module__ , "testpatch2" )
You can’t perform that action at this time.
0 commit comments