[issue1876] bogus attrgetter test in test_operator

Antoine Pitrou report at bugs.python.org
Sun Jan 20 15:16:32 CET 2008


New submission from Antoine Pitrou:

In test_operator we find the following lines:

        class C(object):
            def __getattr(self, name):
                raise SyntaxError
        self.failUnlessRaises(AttributeError,
operator.attrgetter('foo'), C())

Obviously "__getattr" has no effect. However, when changing it to
"__getattr__", the test fails. Is there is any motivation for this test
in the first place? If yes, why the typo and why the error when the typo
is corrected?

----------
components: Tests
messages: 61297
nosy: pitrou
severity: normal
status: open
title: bogus attrgetter test in test_operator
type: behavior
versions: Python 2.6

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1876>
__________________________________


More information about the Python-bugs-list mailing list