[IMP] core: clarify docs about config --test-tags
Technical name is not added to test_tags since https://github.com/odoo/odoo/commit/95b4f2ab4b5698ab3a28c9c35ac8da6fb6def983 at_install tag is added by default since introducing @tagged decorator: https://github.com/odoo/odoo/commit/b356b190338e3ee032b9e3a7f670f76468965006 Clarify how special tags at_install/post_install work. Also, add dots for @tagged doc, because otherwise we have a mess in sphinx docs. --- task-2431630 closes odoo/odoo#71329 X-original-commit: e4bf1e7dca2a9ef6dabf3f201d086ae77ff993d9 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
@@ -2553,11 +2553,11 @@ def _get_node(view, f, *arg):
|
||||
|
||||
def tagged(*tags):
|
||||
"""
|
||||
A decorator to tag BaseCase objects
|
||||
Tags are stored in a set that can be accessed from a 'test_tags' attribute
|
||||
A tag prefixed by '-' will remove the tag e.g. to remove the 'standard' tag
|
||||
A decorator to tag BaseCase objects.
|
||||
Tags are stored in a set that can be accessed from a 'test_tags' attribute.
|
||||
A tag prefixed by '-' will remove the tag e.g. to remove the 'standard' tag.
|
||||
By default, all Test classes from odoo.tests.common have a test_tags
|
||||
attribute that defaults to 'standard' and also the module technical name
|
||||
attribute that defaults to 'standard' and 'at_install'.
|
||||
When using class inheritance, the tags are NOT inherited.
|
||||
"""
|
||||
def tags_decorator(obj):
|
||||
|
||||
+13
-4
@@ -162,14 +162,23 @@ class configmanager(object):
|
||||
dest='test_enable',
|
||||
help="Enable unit tests.")
|
||||
group.add_option("--test-tags", dest="test_tags",
|
||||
help="""Comma-separated list of spec to filter which tests to execute. Enable unit tests if set.
|
||||
help="""Comma-separated list of specs to filter which tests to execute. Enable unit tests if set.
|
||||
A filter spec has the format: [-][tag][/module][:class][.method]
|
||||
The '-' specifies if we want to include or exclude tests matching this spec.
|
||||
The tag will match tags added on a class with a @tagged decorator. By default tag value is 'standard' when not
|
||||
given on include mode. '*' will match all tags. Tag will also match module name (deprecated, use /module)
|
||||
The tag will match tags added on a class with a @tagged decorator
|
||||
(all Test classes have 'standard' and 'at_install' tags
|
||||
until explicitly removed, see the decorator documentation).
|
||||
'*' will match all tags.
|
||||
If tag is omitted on include mode, its value is 'standard'.
|
||||
If tag is omitted on exclude mode, its value is '*'.
|
||||
The module, class, and method will respectively match the module name, test class name and test method name.
|
||||
examples: :TestClass.test_func,/test_module,external
|
||||
""")
|
||||
|
||||
Filtering and executing the tests happens twice: right
|
||||
after each module installation/update and at the end
|
||||
of the modules loading. At each stage tests are filtered
|
||||
by --test-tags specs and additionally by dynamic specs
|
||||
'at_install' and 'post_install' correspondingly.""")
|
||||
|
||||
group.add_option("--screencasts", dest="screencasts", action="store", my_default=None,
|
||||
metavar='DIR',
|
||||
|
||||
Reference in New Issue
Block a user