summaryrefslogtreecommitdiff
path: root/docs/topics/testing/tools.txt
diff options
context:
space:
mode:
authorWill Ayd <william.ayd@icloud.com>2017-12-01 11:00:45 -0500
committerTim Graham <timograham@gmail.com>2018-01-08 20:57:33 -0500
commit09530e61a0035192ca8bcdebc5ead13d14c16eb0 (patch)
treecd9b31edf7f69adf3e64ae0e54e31a37e92914a5 /docs/topics/testing/tools.txt
parentacd3baf2ae3f74846731447df66e8c3ce7a772f7 (diff)
Fixed #28869 -- Made tagged test classes and methods inherit tags from parents.
Diffstat (limited to 'docs/topics/testing/tools.txt')
-rw-r--r--docs/topics/testing/tools.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt
index d349efe7a0..65d1fb463b 100644
--- a/docs/topics/testing/tools.txt
+++ b/docs/topics/testing/tools.txt
@@ -1619,6 +1619,25 @@ You can also tag a test case::
class SampleTestCase(TestCase):
...
+Subclasses inherit tags from superclasses, and methods inherit tags from their
+class. Given::
+
+ @tag('foo')
+ class SampleTestCaseChild(SampleTestCase):
+
+ @tag('bar')
+ def test(self):
+ ...
+
+``SampleTestCaseChild.test`` will be labeled with ``'slow'``, ``'core'``,
+``'bar'``, and ``'foo'``.
+
+.. versionchanged:: 2.1
+
+ In older versions, tagged tests don't inherit tags from classes, and
+ tagged subclasses don't inherit tags from superclasses. For example,
+ ``SampleTestCaseChild.test`` is labeled only with ``'bar'``.
+
Then you can choose which tests to run. For example, to run only fast tests:
.. code-block:: console