Skip to content

Commit

Permalink
Add session.notify example to docs (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
FollowTheProcess committed Sep 9, 2021
1 parent d537c55 commit 5f9cffa
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions nox/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,20 @@ def notify(
This method is idempotent; multiple notifications to the same session
have no effect.
A common use case is to notify a code coverage analysis session
from a test session::
@nox.session
def test(session):
session.run("pytest")
session.notify("coverage")
@nox.session
def coverage(session):
session.run("coverage")
Now if you run `nox -s test`, the coverage session will run afterwards.
Args:
target (Union[str, Callable]): The session to be notified. This
may be specified as the appropriate string (same as used for
Expand Down

0 comments on commit 5f9cffa

Please sign in to comment.