Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Lib/unittest/test/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,8 @@ def testShortDescriptionWithMultiLineDocstring(self):
'Tests shortDescription() for a method with a longer '
'docstring.')

@unittest.skipIf(sys.flags.optimize >= 2,
"Docstrings are omitted with -O2 and above")
def testShortDescriptionWhitespaceTrimming(self):
"""
Tests shortDescription() whitespace is trimmed, so that the first
Expand Down
4 changes: 2 additions & 2 deletions Lib/unittest/test/test_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def removeTest():

class FooBar(unittest.TestCase):
def testPass(self):
assert True
pass
def testFail(self):
assert False
raise AssertionError

class FooBarLoader(unittest.TestLoader):
"""Test loader that returns a suite containing FooBar."""
Expand Down
3 changes: 2 additions & 1 deletion Lib/unittest/test/testmock/testpatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1875,9 +1875,10 @@ def foo(x=0):
self.assertEqual(foo(), 1)
self.assertEqual(foo(), 0)

orig_doc = foo.__doc__
with patch.object(foo, '__doc__', "FUN"):
self.assertEqual(foo.__doc__, "FUN")
self.assertEqual(foo.__doc__, "TEST")
self.assertEqual(foo.__doc__, orig_doc)

with patch.object(foo, '__module__', "testpatch2"):
self.assertEqual(foo.__module__, "testpatch2")
Expand Down