stubs
raw JSON → 1.0.0 verified Fri May 01 auth: no python
Tools for setting up stubs and mocks in Python tests. Version 1.0.0, currently at initial release with no defined release cadence.
pip install stubs Common errors
error AttributeError: module 'stubs' has no attribute 'Stub' ↓
cause Improper import; using 'import stubs' then trying to access 'stubs.Stub'.
fix
Use 'from stubs import Stub'.
Warnings
gotcha No known breaking changes as library is at version 1.0.0. However, the API is minimal; ensure you use the correct import path. ↓
fix Use 'from stubs import Stub' instead of 'import stubs'.
Imports
- Stub
from stubs import Stub
Quickstart
from stubs import Stub
stub = Stub()
stub.return_value('func', 42)
result = stub.func()
print(result) # 42