Skip to content

2.0.0a3

Pre-release
Pre-release

Choose a tag to compare

@kaste kaste released this 21 Feb 16:56
· 92 commits to master since this release
  • Added first-class async/await stubbing support: async callables now preserve
    awaitable behavior for thenReturn, thenRaise, and thenAnswer (including
    sync and async answer callables), with parity across when, when2,
    patch, and expect.
    Note that async introspection metadata (e.g. inspect.iscoroutinefunction)
    for stub wrappers is currently implemented only on Python 3.12+.

  • Added first-class property/descriptor stubbing support, including class-level property
    stubbing via when(F).p.thenReturn(...) and thenCallOriginalImplementation() support for
    property stubs (including chained answers like
    thenReturn(...).thenCallOriginalImplementation()). Stubbing instance properties now fails
    fast with clear guidance to use class-level stubbing (when(F).p...).