summaryrefslogtreecommitdiff
path: root/pytest.py
diff options
context:
space:
mode:
authorPierre-Yves David <pierre-yves.david@logilab.fr>2008-09-09 17:06:19 +0200
committerPierre-Yves David <pierre-yves.david@logilab.fr>2008-09-09 17:06:19 +0200
commit4d272ff5d7768873a0d46bb2f4d053a62abb4c69 (patch)
tree69a9ebb4c2c3c7d039370c0109877e387b5f7a8d /pytest.py
parent373fac46dd48c21ba43d4968b69a4ae13807f1d4 (diff)
downloadlogilab-common-4d272ff5d7768873a0d46bb2f4d053a62abb4c69.tar.gz
doc upgrade to test tagging
Diffstat (limited to 'pytest.py')
-rw-r--r--pytest.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/pytest.py b/pytest.py
index 4f46a4d..844bd4f 100644
--- a/pytest.py
+++ b/pytest.py
@@ -46,6 +46,41 @@ the ``optval`` method::
def test_foo(self):
loglevel = self.optval('loglevel')
# ...
+
+
+You can also tag your tag your test for fine filtering
+
+With those tag::
+
+ from logilab.common.testlib import tag, TestCase
+
+ class Exemple(TestCase):
+
+ @tag('rouge', 'carre')
+ def toto(self):
+ pass
+
+ @tag('carre', 'vert')
+ def tata(self):
+ pass
+
+ @tag('rouge')
+ def titi(test):
+ pass
+
+you can filter the function with a simpe python expression
+
+ * ``toto`` and ``titi`` match ``rouge``
+
+ * ``toto``, ``tata`` and ``titi``, match ``rouge or carre``
+
+ * ``tata`` and ``titi`` match``rouge ^ carre``
+
+ * ``titi`` match ``rouge and not carre``
+
+
+
+
:copyright: 2000-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
@@ -61,6 +96,7 @@ examples:
pytest path/to/mytests.py
pytest path/to/mytests.py TheseTests
pytest path/to/mytests.py TheseTests.test_thisone
+pytest path/to/mytests.py -m '(not long and database) or regr'
pytest one (will run both test_thisone and test_thatone)
pytest path/to/mytests.py -s not (will skip test_notthisone)