Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2c6fcf6
Increase max-line-length to 89
kaste Feb 16, 2026
3260146
Implement InOrder
kaste Nov 17, 2025
ef52f4d
Ensure invocations do not get recorded after detach
kaste Nov 17, 2025
c907d04
Have only the public objects in the error messages
kaste Nov 17, 2025
987b3fa
Tune error messages to not begin with just a newline
kaste Nov 18, 2025
26660b2
Fix: `InOrder` and `verify` must accept `object`
kaste Nov 18, 2025
b77e27f
Change error message to '<obj>.<method>' style
kaste Nov 18, 2025
eb0be83
Get the basic messages right
kaste Nov 18, 2025
28892b8
Get all the variable names right
kaste Nov 18, 2025
e2d6ee0
Towards the standard verify signature
kaste Nov 18, 2025
c2b460f
Allow multiple entrance
kaste Nov 18, 2025
0520a59
Ensure the constructor works with unhashable objects
kaste Nov 18, 2025
fd137cc
Use identity checks in InOrder registry
kaste Feb 15, 2026
28ac4fb
Fix InOrder contiguous argument verification
kaste Feb 15, 2026
92b5510
Attach InOrder to mocks registered after creation
kaste Feb 15, 2026
5f9f9f4
Raise to Python >=3.8
kaste Feb 16, 2026
daddfdc
Fix InOrder zero-lower-bound verification paths
kaste Feb 16, 2026
52d5ca3
Add open-ended between=(0,) InOrder zero-lower-bound tests
kaste Feb 16, 2026
74190d7
Allow InOrder zero-lower-bound verify on same-mock arg mismatch
kaste Feb 16, 2026
21eafc9
Add InOrder zero-lower-bound test for consumed queue
kaste Feb 16, 2026
79c7fa7
Add InOrder zero-verify stub-usage regression tests
kaste Feb 16, 2026
b435a81
Improve InOrder mismatch messages with safe callsite labels
kaste Feb 16, 2026
bbdd32f
Document new cross-mock InOrder API in changelog
kaste Feb 16, 2026
7b0a322
Export InOrder and document first-class API
kaste Feb 16, 2026
ebbce99
Deprecate legacy inorder.verify helper
kaste Feb 16, 2026
3796b3e
Refactor InOrder to facade/impl and hide internal API
kaste Feb 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ ignore =
E731
exclude = .git,.github,.cache,.mypy_cache,.pytest_cache,docs,.venv,.build,build
max-complexity = 10
max-line-length = 79
max-line-length = 89
19 changes: 19 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@ Release 2.0.0
check can be disabled with the environment variable `MOCKITO_CONTEXT_MANAGERS_CHECK_USAGE="0"`.
- The `between` matcher now supports open ranges, e.g. `between=(0,)` to assert that at least
0 interactions occurred.
- Added a first-class `InOrder` API via ``mockito.InOrder`` (also available as
``mockito.inorder.InOrder``). The legacy in-order mode only supported one mock at a time;
the new API supports true cross-mock order verification.

Migration (old limited style -> new style)::

# Before (legacy, single-mock order only)
from mockito import inorder
inorder.verify(cat).meow()
inorder.verify(cat).purr()

# Now (preferred, explicit cross-mock order)
from mockito import InOrder
in_order = InOrder(cat, dog)
in_order.verify(cat).meow()
in_order.verify(dog).bark()

- The legacy in-order verification mode (``inorder.verify(...)``)
is deprecated in favor of ``InOrder(...)``.



Expand Down
6 changes: 6 additions & 0 deletions docs/the-functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ This looks like a plethora of verification functions, and especially since you
.. autofunction:: verifyZeroInteractions
.. autofunction:: verifyExpectedInteractions

In-order verification across one or multiple observed objects is provided by
:class:`InOrder`.

.. autoclass:: InOrder
:class-doc-from: class

Note that `verifyExpectedInteractions` was named `verifyNoUnwantedInteractions` in v1.
The usage of `verifyNoUnwantedInteractions` is deprecated.

Expand Down
2 changes: 2 additions & 0 deletions mockito/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
ArgumentError,
)
from . import inorder
from .inorder import InOrder
from .spying import spy, spy2
from .mocking import mock
from .verification import VerificationError
Expand Down Expand Up @@ -67,6 +68,7 @@
'verifyExpectedInteractions',
'verifyStubbedInvocationsAreUsed',
'inorder',
'InOrder',
'unstub',
'forget_invocations',
'VerificationError',
Expand Down
Loading
Loading