Mockito

Latest version: v1.5.4

Safety actively analyzes 706267 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 5

1.3.0

--------------------------------

- Teach `captor` to remember all used values (shashankrnr32). E.g.

::

arg = captor()
mock.do_something(123)
mock.do_something(456)
verify(mock).do_something(arg)
assert arg.all_values == [123, 456]

1.2.2

---------------------------------

- Fix typo in ``spy2`` doc

1.2.1

---------------------------------

- nielsvaneck fixed how we can lookup inherited classmethods.

1.2.0

---------------------------------

- Code base now is python 3 compatible. No 2to3 anymore.
- Fine tune error messages on unexpected calls or verifications. E.g. if you expect ``when(dog).bark('Wuff')`` but on call time do ``dog.bark('Wufff')``. Likewise, if you call ``dog.bark('Miau')`` and then ``verify(dog).bark('Maui')``.
- felixonmars fixed a small compatibility issue with python 3.8
- Mocking properties has become a bit easier. (26) E.g.

::

prop = mock()
when(prop).__get__(...).thenReturn(23)
m = mock({'name': prop})

1.1.1

-------------------------------

- Fix: The context manager (``with``) has now a proper implementation
- Fix: Calling ``patch`` with two arguments can now be used with ``with``
- Fix: Do not treat the placeholder arguments (Ellipsis, args, kwargs) as special on call time anymore. (T.i. they only have a meaning when stubbing or verifying.)
- Enhancement: Changed some truthy or equality tests to identity (``is``) tests. This reduces edge-cases where some user object defines ``__eq__`` or ``__bool__``. (Hello _numpy_!)

1.1.0

---------------------------

- Added ``forget_invocations`` function. Thanks to maximkulkin

This is generally useful if you already call mocks during your setup routine.
Now you could call ``forget_invocations`` at the end of your setup, and
have a clean 'recording' for your actual test code. T.i. you don't have
to count the invocations from your setup code anymore.

Page 2 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.