# Path: invoke/util.py
# LOG_FORMAT = "%(name)s.%(module)s.%(funcName)s: %(message)s"
# def enable_logging():
# def task_name_sort_key(name):
# def cd(where):
# def has_fileno(stream):
# def isatty(stream):
# def encode_output(string, encoding):
# def helpline(obj):
#     def __init__(self, **kwargs):
#     def run(self):
#     def exception(self):
#     def is_dead(self):
#     def __repr__(self):
# class ExceptionHandlingThread(threading.Thread):


from invoke.vendor.six.moves.queue import Queue
from invoke.util import ExceptionWrapper, ExceptionHandlingThread as EHThread



# TODO: rename
class ExceptionHandlingThread_:
    class via_target:
        def setup(self):
            def worker(q):
                q.put(7)

            self.worker = worker

        def base_case(self):
            queue = Queue()
            t = EHThread(target=self.worker, args=[queue])
            t.start()
            t.join()
            assert queue.get(block=False) == 7
            assert queue.empty()

        def catches_exceptions(self):
            # Induce exception by submitting a bad queue obj

# Path: invoke/util.py
# LOG_FORMAT = "%(name)s.%(module)s.%(funcName)s: %(message)s"
# def enable_logging():
# def task_name_sort_key(name):
# def cd(where):
# def has_fileno(stream):
# def isatty(stream):
# def encode_output(string, encoding):
# def helpline(obj):
#     def __init__(self, **kwargs):
#     def run(self):
#     def exception(self):
#     def is_dead(self):
#     def __repr__(self):
# class ExceptionHandlingThread(threading.Thread):


# Path: tests/concurrency.py
from invoke.vendor.six.moves.queue import Queue
from invoke.util import ExceptionWrapper, ExceptionHandlingThread as EHThread




# TODO: rename
class ExceptionHandlingThread_:
    class via_target:
        def setup(self):
            def worker(q):
                q.put(7)

            self.worker = worker

        def base_case(self):
            queue = Queue()
            t = EHThread(target=self.worker, args=[queue])
            t.start()
            t.join()
            assert queue.get(block=False) == 7
            assert queue.empty()

        def catches_exceptions(self):
            # Induce exception by submitting a bad queue obj

            t = EHThread(target=self.worker, args=[None])