[docs] Typos in documentation

Berker Peksağ berker.peksag at gmail.com
Wed May 20 13:25:51 CEST 2015


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


More information about the docs mailing list