# Path: taipan/_compat.py
# IS_PY26 = sys.version_info[:2] == (2, 6)
# IS_PY3 = sys.version_info[0] == 3
# class MetaclassDecorator(object):
#     def __init__(self, meta):
#     def __call__(self, cls):
# 
# Path: taipan/collections/lists.py
# def head(list_):
# def last(list_):
# def tail(list_):
# def init(list_):
# def find(*args, **kwargs):
# def findlast(*args, **kwargs):
# def index(*args, **kwargs):
# def lastindex(*args, **kwargs):
# def _index(*args, **kwargs):
# def intersperse(elem, list_):
# def intercalate(elems, list_):
# def concat(list_):
# 
# Path: taipan/strings.py
# def is_string(s):
#     """Checks whether given object ``s`` is a string of characters.
#     :return: ``True`` if ``s`` is a string, ``False`` otherwise
#     """
#     return isinstance(s, BaseString)
# 
# Path: taipan/testing/_unittest.py



import os
import taipan.testing as __unit__
from taipan._compat import StringIO
from taipan.collections import lists
from taipan.strings import is_string
from taipan.testing._unittest import TestCase, TestLoader, TextTestRunner


class _StageDecorators(TestCase):
    """Base class for test cases for test stage decorators."""
    #: Stream used to record test output
    test_output = StringIO()

    class TestCase(__unit__.TestCase):
        """Base class for Taipan test cases that we'll be running
        and checking the results of.
        """
        def test_print(self):
            self._print(TEST_TEXT)

        @classmethod
        def _print(cls, text):
            """Print text to a text output stream
            that can be easily asserted upon ater.
            """
            print(text, file=_StageDecorators.test_output)

    # Utility functions

    def _run_tests(self, testcase_class=None):
        """Runs the tests from specified TestCase class
        and returns their output.
        """
        # run the tests, suppressing all the output that'd go to stdout/stderr
        testcase_class = testcase_class or self.TestCase
        suite = TestLoader().loadTestsFromTestCase(testcase_class)

# Path: taipan/_compat.py
# IS_PY26 = sys.version_info[:2] == (2, 6)
# IS_PY3 = sys.version_info[0] == 3
# class MetaclassDecorator(object):
#     def __init__(self, meta):
#     def __call__(self, cls):
# 
# Path: taipan/collections/lists.py
# def head(list_):
# def last(list_):
# def tail(list_):
# def init(list_):
# def find(*args, **kwargs):
# def findlast(*args, **kwargs):
# def index(*args, **kwargs):
# def lastindex(*args, **kwargs):
# def _index(*args, **kwargs):
# def intersperse(elem, list_):
# def intercalate(elems, list_):
# def concat(list_):
# 
# Path: taipan/strings.py
# def is_string(s):
#     """Checks whether given object ``s`` is a string of characters.
#     :return: ``True`` if ``s`` is a string, ``False`` otherwise
#     """
#     return isinstance(s, BaseString)
# 
# Path: taipan/testing/_unittest.py



# Path: tests/test_testing/test_decorators.py
import os
import taipan.testing as __unit__
from taipan._compat import StringIO
from taipan.collections import lists
from taipan.strings import is_string
from taipan.testing._unittest import TestCase, TestLoader, TextTestRunner



class _StageDecorators(TestCase):
    """Base class for test cases for test stage decorators."""
    #: Stream used to record test output
    test_output = StringIO()

    class TestCase(__unit__.TestCase):
        """Base class for Taipan test cases that we'll be running
        and checking the results of.
        """
        def test_print(self):
            self._print(TEST_TEXT)

        @classmethod
        def _print(cls, text):
            """Print text to a text output stream
            that can be easily asserted upon ater.
            """
            print(text, file=_StageDecorators.test_output)

    # Utility functions

    def _run_tests(self, testcase_class=None):
        """Runs the tests from specified TestCase class
        and returns their output.
        """
        # run the tests, suppressing all the output that'd go to stdout/stderr
        testcase_class = testcase_class or self.TestCase
        suite = TestLoader().loadTestsFromTestCase(testcase_class)

        TextTestRunner(stream=StringIO(), verbosity=0).run(suite)