[docs] Typos in documentation

Adrian Tirla atirla at kcg.com
Wed May 20 14:35:35 CEST 2015


My bad, please excuse me. I've pasted the example and I was wondering why it doesn't fail :)  so I've thought it was a typo.

Good stuff. Sorry once again.

Regards,
Adrian

--
Adrian Tirla

KCG Europe Limited
City Place House, 55 Basinghall Street
London, EC2V 5DU
atirla at kcg.com
www.kcg.com
+44 (0)20 7997 7876



-----Original Message-----
From: Berker Peksağ [mailto:berker.peksag at gmail.com]
Sent: Wednesday, May 20, 2015 12:26 PM
To: Adrian Tirla
Cc: testing-in-python at lists.idyll.org; docs at python.org
Subject: Re: [docs] Typos in documentation

On Wed, May 20, 2015 at 12:31 PM, Adrian Tirla <atirla at kcg.com> wrote:
>
> Hi guys,
>
>
>
> I hope you’re well.
>
>
>
> I was reading the documentation for mocks here:
>
> https://docs.python.org/3.4/library/unittest.mock.html?highlight=mock#
> module-unittest.mock
>
> http://www.voidspace.org.uk/python/mock/helpers.html#auto-speccing
>
> and I’ve spotted some typos “assret” instead of “assert”.
>
>
>
> >>> mock = Mock(name='Thing', return_value=None)
>
> >>> mock(1, 2, 3)
>
> >>> mock.assret_called_once_with(4, 5, 6)

Hi Adrian,

Thanks for the report, but I think the typos are intentional.

From https://docs.python.org/3.4/library/unittest.mock.html#autospeccing:

    Because mocks auto-create attributes on demand, and allow you to call them with arbitrary arguments, if you misspell one of these assert methods then your assertion is gone:

Then the following snippet proves that the paragraph above is correct:

    [...]
    mock.assret_called_once_with(4, 5, 6)

    Your tests can pass silently and incorrectly because of the typo.

--Berker
KCG Europe Limited is authorized and regulated by the Financial Conduct Authority. Registered Office 55 Basinghall Street, London, EC2V 5DU. Registered in England & Wales No. 03632121

This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature. For additional important disclaimers and disclosures regarding KCG’s products and services, please click on the following link:

http://www.kcg.com/legal/global-disclosures


More information about the docs mailing list