Skip to content

Commit 134fb01

Browse files
committed
Add chaining showcase to index.rst
1 parent 9803548 commit 134fb01

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

docs/index.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ Super easy to set up different answers.
5656
.thenRaise(Timeout("I'm flaky")) \
5757
.thenReturn(mock({'status': 200, 'text': 'Ok'}))
5858

59+
State-of-the-art, high-five chaining::
60+
61+
# SQLAlchemy, fluently
62+
with when(User).query.filter_by(...).first().thenReturn("A user"):
63+
assert User.query.filter_by(username='admin').first() == "A user"
64+
5965
State-of-the-art, high-five argument matchers::
6066

6167
# Use the Ellipsis, if you don't care

0 commit comments

Comments
 (0)