Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed documentation for tags to link properly. #1578

Merged
merged 1 commit into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/writing-a-locustfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ and then Python's ``random.choice()`` is used pick tasks from the list.
Tagging tasks
-------------

By tagging tasks using the `tag <locust.tag>` decorator, you can be picky about what tasks are
By tagging tasks using the :py:func:`@tag <locust.tag>` decorator, you can be picky about what tasks are
executed during the test using the :code:`--tags` and :code:`--exclude-tags` arguments. Consider
the following example:

Expand Down Expand Up @@ -377,8 +377,8 @@ parent TaskSet instance.

Tags and TaskSets
------------------
You can tag TaskSets using the `tag <locust.tag>` decorator in a similar way to normal tasks, as
described `above <tagging-tasks>`, but there are some nuances worth mentioning. Tagging a TaskSet
You can tag TaskSets using the :py:func:`@tag <locust.tag>` decorator in a similar way to normal tasks, as
described :ref:`above <tagging-tasks>`, but there are some nuances worth mentioning. Tagging a TaskSet
will automatically apply the tag(s) to all of the TaskSet's tasks. Furthermore, if you tag a task
within a nested TaskSet, locust will execute that task even if the TaskSet isn't tagged.

Expand Down
6 changes: 3 additions & 3 deletions locust/user/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def my_task()

def tag(*tags):
"""
Decorator for tagging tasks and TaskSets with the given tag name. You can then limit the test
to only execute tasks that are tagged with any of the tags provided by the --tags command-line
argument. Example::
Decorator for tagging tasks and TaskSets with the given tag name. You can
then limit the test to only execute tasks that are tagged with any of the
tags provided by the :code:`--tags` command-line argument. Example::

class ForumPage(TaskSet):
@tag('thread')
Expand Down