Skip to content

2.0.0a4

Pre-release
Pre-release

Choose a tag to compare

@kaste kaste released this 24 Feb 19:47
· 75 commits to master since this release
ca5889b
  • Allow ... in fixed argument positions as an ad-hoc any matcher.
    Trailing positional ... keeps its existing "rest" semantics.

  • Expanded mock({...}) constructor shorthands. Refer https://mockito-python.readthedocs.io/en/latest/mock-shorthands.html

  • Added chained stubbing and expectations across call/property hops, e.g.
    when(cat).meow().purr().thenReturn(...), when(User).query.filter_by(...).first(), and
    expect(cat, times=1).meow().purr(), including cleanup that preserves sibling chain branches.

  • BREAKING: Stubs for the same method are now sorted by specificity. #110 Rolled back in a5.

    Same-ish are for example

    when(os.path).exists(...).thenCallOriginalImplementation()
    when(os.path).exists('.flake8').thenReturn(False)