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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/memoized_unittest.py

Issue 2580293002: Style change: Rename error variables "e" -> "error" (Closed)
Patch Set: Rebase and fix formatter unittest. Created 4 years 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
OLDNEW
1 # Copyright (c) 2010 Google Inc. All rights reserved. 1 # Copyright (c) 2010 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 test = _TestObject() 64 test = _TestObject()
65 add_one = test.memoized_add_one 65 add_one = test.memoized_add_one
66 self.assertEqual(add_one(4), 5) 66 self.assertEqual(add_one(4), 5)
67 self.assertEqual(test.call_count, 1) 67 self.assertEqual(test.call_count, 1)
68 68
69 def test_non_hashable_args(self): 69 def test_non_hashable_args(self):
70 test = _TestObject() 70 test = _TestObject()
71 try: 71 try:
72 test.memoized_add_one([]) 72 test.memoized_add_one([])
73 self.fail('Expected TypeError.') 73 self.fail('Expected TypeError.')
74 except TypeError as e: 74 except TypeError as error:
75 self.assertEqual( 75 self.assertEqual(
76 e.message, 76 error.message,
77 'Cannot call memoized function memoized_add_one with ' 77 'Cannot call memoized function memoized_add_one with '
78 'unhashable arguments: unhashable type: \'list\'') 78 'unhashable arguments: unhashable type: \'list\'')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698