[openstack-dev] [Neutron][qa] The 'spec' parameter of mock.patch()

Nachi Ueno nachi at ntti3.com
Fri Jan 10 23:02:12 UTC 2014

+1 but fixing this looks like take not small time

2014/1/10 Maru Newby <marun at redhat.com>:
> I recently saw a case [1] where a misspelled assertion method (asoptt_called_once_with vs assert_called_once_with) did not result in a test failure because the object it was called on was created by mock.patch() without any of the spec/spec_set/autospec parameters being set.  Might it make sense to require that calls to mock.patch() set autospec=True [2]?
> m.
> 1: https://review.openstack.org/#/c/61105/7/neutron/tests/unit/openvswitch/test_ovs_lib.py (line 162)
> 2: http://www.voidspace.org.uk/python/mock/patch.html#mock.patch
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

More information about the OpenStack-dev mailing list