mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
Unittest - Add mechanism to skip task and taskd tests
* When testing multiple clients vs server versions, repeating client tests is unnecessary. By setting the env variables TASKW_SKIP and TASKD_SKIP it will now be possible to skip all task (client only) and taskd (client + server) tests, respectively.
This commit is contained in:
parent
72e8a73ae0
commit
2a198d59fe
4 changed files with 25 additions and 5 deletions
|
@ -2,9 +2,11 @@
|
|||
|
||||
import unittest
|
||||
import sys
|
||||
from .utils import TASKW_SKIP, TASKD_SKIP
|
||||
from .taskd import Taskd
|
||||
|
||||
|
||||
class TestCase(unittest.TestCase):
|
||||
class BaseTestCase(unittest.TestCase):
|
||||
def diag(self, out):
|
||||
sys.stdout.write("# --- diag start ---\n")
|
||||
for line in out.split("\n"):
|
||||
|
@ -12,4 +14,19 @@ class TestCase(unittest.TestCase):
|
|||
sys.stdout.write("# --- diag end ---\n")
|
||||
|
||||
|
||||
@unittest.skipIf(TASKW_SKIP, "TASKW_SKIP set, skipping task tests.")
|
||||
class TestCase(BaseTestCase):
|
||||
"""Automatically skips tests if TASKW_SKIP is present in the environment
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@unittest.skipIf(TASKD_SKIP, "TASKD_SKIP set, skipping taskd tests.")
|
||||
@unittest.skipIf(Taskd.not_available(), "Taskd binary not available")
|
||||
class ServerTestCase(BaseTestCase):
|
||||
"""Automatically skips tests if TASKD_SKIP is present in the environment
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
# vim: ai sts=4 et sw=4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue