Unittest - Bring back diag() for generating TAP output
* Still needs work to make sure output is displayed after the test status (not ok ...) and not before.
This commit is contained in:
@@ -2,5 +2,6 @@
|
|||||||
|
|
||||||
from .task import Task
|
from .task import Task
|
||||||
from .taskd import Taskd
|
from .taskd import Taskd
|
||||||
|
from .testing import TestCase
|
||||||
|
|
||||||
# vim: ai sts=4 et sw=4
|
# vim: ai sts=4 et sw=4
|
||||||
|
|||||||
15
test/basetest/testing.py
Normal file
15
test/basetest/testing.py
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
class TestCase(unittest.TestCase):
|
||||||
|
def diag(self, out):
|
||||||
|
sys.stdout.write("# --- diag start ---\n")
|
||||||
|
for line in out.split("\n"):
|
||||||
|
sys.stdout.write("#" + line + "\n")
|
||||||
|
sys.stdout.write("# --- diag end ---\n")
|
||||||
|
|
||||||
|
|
||||||
|
# vim: ai sts=4 et sw=4
|
||||||
@@ -33,10 +33,10 @@ import unittest
|
|||||||
# Ensure python finds the local simpletap and basetest modules
|
# Ensure python finds the local simpletap and basetest modules
|
||||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
from basetest import Task
|
from basetest import Task, TestCase
|
||||||
|
|
||||||
|
|
||||||
class TestBug1254(unittest.TestCase):
|
class TestBug1254(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.t = Task()
|
self.t = Task()
|
||||||
|
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ import unittest
|
|||||||
# Ensure python finds the local simpletap and basetest modules
|
# Ensure python finds the local simpletap and basetest modules
|
||||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
from basetest import Task
|
from basetest import Task, TestCase
|
||||||
|
|
||||||
|
|
||||||
class TestBug1267(unittest.TestCase):
|
class TestBug1267(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.t = Task()
|
self.t = Task()
|
||||||
|
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ import unittest
|
|||||||
# Ensure python finds the local simpletap and basetest modules
|
# Ensure python finds the local simpletap and basetest modules
|
||||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
from basetest import Task
|
from basetest import Task, TestCase
|
||||||
|
|
||||||
|
|
||||||
class BaseTestBug360(unittest.TestCase):
|
class BaseTestBug360(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
"""Executed before each test in the class"""
|
"""Executed before each test in the class"""
|
||||||
self.t = Task()
|
self.t = Task()
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ from datetime import datetime
|
|||||||
# Ensure python finds the local simpletap module
|
# Ensure python finds the local simpletap module
|
||||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
from basetest import Task, Taskd
|
from basetest import Task, Taskd, TestCase
|
||||||
|
|
||||||
|
|
||||||
class TestCase(unittest.TestCase):
|
class TestBugNumber(TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
"""Executed once before any test in the class"""
|
"""Executed once before any test in the class"""
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ import unittest
|
|||||||
# Ensure python finds the local simpletap and basetest modules
|
# Ensure python finds the local simpletap and basetest modules
|
||||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
from basetest import Task
|
from basetest import Task, TestCase
|
||||||
|
|
||||||
|
|
||||||
class TestBug1300(unittest.TestCase):
|
class TestBug1300(TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUp(cls):
|
def setUp(cls):
|
||||||
cls.t = Task()
|
cls.t = Task()
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ import os
|
|||||||
import unittest
|
import unittest
|
||||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
from basetest import Task
|
from basetest import Task, TestCase
|
||||||
|
|
||||||
|
|
||||||
class TestBug1306(unittest.TestCase):
|
class TestBug1306(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.t = Task()
|
self.t = Task()
|
||||||
|
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ import unittest
|
|||||||
# Ensure python finds the local simpletap and basetest modules
|
# Ensure python finds the local simpletap and basetest modules
|
||||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
from basetest import Task
|
from basetest import Task, TestCase
|
||||||
|
|
||||||
|
|
||||||
class Test285(unittest.TestCase):
|
class Test285(TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls.t = Task()
|
cls.t = Task()
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ from datetime import datetime
|
|||||||
# Ensure python finds the local simpletap module
|
# Ensure python finds the local simpletap module
|
||||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
from basetest import Task
|
from basetest import Task, TestCase
|
||||||
|
|
||||||
|
|
||||||
class TestVersion(unittest.TestCase):
|
class TestVersion(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.t = Task()
|
self.t = Task()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user