[issue21255] Attaching a PropertyMock records calls

2020-02-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21255] Attaching a PropertyMock records calls

2014-04-22 Thread Michael Foord

Michael Foord added the comment:

Not sure, but I guess it would be easy to find out. It will need some digging 
into to find out where the actual bug is. It shouldn't be hard to find though.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21255
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21255] Attaching a PropertyMock records calls

2014-04-16 Thread Michael Foord

New submission from Michael Foord:

What steps will reproduce the problem?

 foo = Mock(name='foo')
 prop = PropertyMock(name='prop')
 type(foo).prop = prop
 foo.attach_mock(prop, 'prop')
 foo.mock_calls
[call.prop(PropertyMock name='foo.prop' id='4300017296')]

Expected:

 foo.mock_calls
[]

What version of the product are you using? On what operating system?

% pip freeze | grep mock
mock==1.0.1

OS X 10.8.4

Please provide any additional information below.

It would be even cooler if attaching a property mock made calls to the 
property appear in the mock_calls for the hosting mock without having to attach 
it, the way it does with a non-property method :)

I use mock every day now and am firmly of the opinion it is far, far more 
awesome than sliced bread. Thanks for making it available to the Python 
community :)

--
assignee: michael.foord
components: Library (Lib)
messages: 216488
nosy: kushal.das, michael.foord
priority: normal
severity: normal
stage: needs patch
status: open
title: Attaching a PropertyMock records calls
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21255
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21255] Attaching a PropertyMock records calls

2014-04-16 Thread Éric Araujo

Éric Araujo added the comment:

 type(foo).prop = prop
 foo.attach_mock(prop, 'prop')

Are both of these lines needed?

--
nosy: +eric.araujo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21255
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com