What steps will reproduce the problem?
1. create a class A that defines __contains__
2. create a class B that inherits from A but does not override __contains__
3. try to write a test and stub out __contains__ for the instance of B
You will get a TypeError raised because of current implementation __contains__
lookup:
...
contains = self._class_to_mock.__dict__.get('__contains__', None)
if contains is None:
raise TypeError('unsubscriptable object')
...
What is the expected output? What do you see instead?
The __contains__ should be properly stubbed out in class B object instance
What version of the product are you using? On what operating system?
Python 2.7.2
Windows
Original issue reported on code.google.com by okosen...@gmail.com on 3 Sep 2011 at 1:01
Original issue reported on code.google.com by
okosen...@gmail.com
on 3 Sep 2011 at 1:01