This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Randy Syring
Recipients Dima.Tisnek, Randy Syring, rbcollins
Date 2015-07-31.03:35:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1438313706.93.0.537190622098.issue24758@psf.upfronthosting.co.za>
In-reply-to
Content
Old functionality:

(temp)rsyring@loftex:~/projects/hllapi-src$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mock
>>> mock.__version__
'1.0.0'
>>> m = mock.Mock()
>>> m.assert_screen_status.call_count
0

New functionality:

(temp)rsyring@loftex:~/projects/hllapi-src$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mock
>>> mock.__version__
'1.1.0'
>>> m = mock.Mock()
>>> m.assert_screen_status.call_count
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/rsyring/.virtualenvs/temp/local/lib/python2.7/site-packages/mock/mock.py", line 714, in __getattr__
    raise AttributeError(name)
AttributeError: assert_screen_status

In my case, the objects I was patching had a legit method like assert_screen_status().  But, after upgrading Mock, the use of those methods started throwing AttributeError's even though it was very obvious that a) the methods existed on the real objects and b) Mock is supposed to let me call anything on I want.  As I said previously, this was a VERY confusing situation to figure out.
History
Date User Action Args
2015-07-31 03:35:06Randy Syringsetrecipients: + Randy Syring, rbcollins, Dima.Tisnek
2015-07-31 03:35:06Randy Syringsetmessageid: <1438313706.93.0.537190622098.issue24758@psf.upfronthosting.co.za>
2015-07-31 03:35:06Randy Syringlinkissue24758 messages
2015-07-31 03:35:06Randy Syringcreate