Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: third_party/twisted_8_1/twisted/test/test_assertions.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # -*- test-case-name: twisted.test.test_assertions -*-
2 # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
3 # See LICENSE for details.
4
5 from twisted.trial import unittest
6 from twisted.python import failure
7
8 class Assertions(unittest.TestCase):
9 def testExceptions(self):
10 exc = self.assertRaises(ZeroDivisionError, lambda: 1/0)
11 assert isinstance(exc, ZeroDivisionError), "ZeroDivisionError instance n ot returned"
12
13 for func in [lambda: 1/0, lambda: None]:
14 try:
15 self.assertRaises(ValueError, func)
16 except unittest.FailTest:
17 # Success!
18 pass
19 except:
20 raise unittest.FailTest("FailTest not raised", failure.Failure() .getTraceback())
21 else:
22 raise unittest.FailTest("FailTest not raised")
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/test/test_application.py ('k') | third_party/twisted_8_1/twisted/test/test_banana.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698