Allow spy operations to nest spy operations.

Review Request #11797 — Created Aug. 19, 2021 and submitted — Latest diff uploaded

Information

kgb
master

Reviewers

kgb

Spy operations that take list of expected calls can now define an op
key in a call for a nested spy operation. This allows them to take
advantage of useful ops like SpyOpReturn or SpyOpRaise. It also
allows for more complex rulesets that nest SpyOpMatchInOrder within a
SpyOpMatchAny, which is useful when there's a lot of calls to a
utility function with different arguments.

This will be the major feature for 6.1.

Unit tests pass for all supported versions of Python.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Allow spy operations to nest spy operations.
Spy operations that take list of expected calls can now define an `op` key in a call for a nested spy operation. This allows them to take advantage of useful ops like `SpyOpReturn` or `SpyOpRaise`. It also allows for more complex rulesets that nest `SpyOpMatchInOrder` within a `SpyOpMatchAny`, which is useful when there's a lot of calls to a utility function with different arguments. This will be the major feature for 6.1.
bec3b100b96d27c2b257a5b50c8b55c329b95cb1 Christian Hammond
README.rst
kgb/ops.py
kgb/tests/base.py
kgb/tests/test_ops.py
Loading...