Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f36573

Browse files
committed
Use non-deprecated method in the example
1 parent 50dcfc5 commit 0f36573

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/library/unittest.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ Test cases
816816
If only the *exception* argument is given, returns a context manager so
817817
that the code under test can be written inline rather than as a function::
818818

819-
with self.failUnlessRaises(some_error_class):
819+
with self.assertRaises(SomeException):
820820
do_something()
821821

822822
.. versionchanged:: 3.1

0 commit comments

Comments
 (0)