Kaydet (Commit) 6f7e2d0a authored tarafından Georg Brandl's avatar Georg Brandl

#1876: fix typos in test_operator.

üst 48723510
...@@ -382,9 +382,9 @@ class OperatorTestCase(unittest.TestCase): ...@@ -382,9 +382,9 @@ class OperatorTestCase(unittest.TestCase):
self.assertRaises(TypeError, operator.attrgetter('x', (), 'y'), record) self.assertRaises(TypeError, operator.attrgetter('x', (), 'y'), record)
class C(object): class C(object):
def __getattr(self, name): def __getattr__(self, name):
raise SyntaxError raise SyntaxError
self.failUnlessRaises(AttributeError, operator.attrgetter('foo'), C()) self.failUnlessRaises(SyntaxError, operator.attrgetter('foo'), C())
def test_itemgetter(self): def test_itemgetter(self):
a = 'ABCDE' a = 'ABCDE'
...@@ -394,9 +394,9 @@ class OperatorTestCase(unittest.TestCase): ...@@ -394,9 +394,9 @@ class OperatorTestCase(unittest.TestCase):
self.assertRaises(IndexError, f, a) self.assertRaises(IndexError, f, a)
class C(object): class C(object):
def __getitem(self, name): def __getitem__(self, name):
raise SyntaxError raise SyntaxError
self.failUnlessRaises(TypeError, operator.itemgetter(42), C()) self.failUnlessRaises(SyntaxError, operator.itemgetter(42), C())
f = operator.itemgetter('name') f = operator.itemgetter('name')
self.assertRaises(TypeError, f, a) self.assertRaises(TypeError, f, a)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment