def teardown_method(self, method):
    executor = getattr(self, 'executor', None)
    if (executor is not None):
        expect_broken_pool = hasattr(method, 'broken_pool')
        for mark in getattr(method, 'pytestmark', []):
            if (mark.name == 'broken_pool'):
                expect_broken_pool = True
        is_actually_broken = (executor._flags.broken is not None)
        assert (is_actually_broken == expect_broken_pool)
        t_start = time.time()
        executor.shutdown(wait=True, kill_workers=True)
        dt = (time.time() - t_start)
        assert (dt < 10), 'Executor took too long to shutdown'
    _check_subprocesses_number(executor, 0)
def teardown_method(self, method):
    executor = getattr(self, 'executor', None)
    if (executor is not None):
        expect_broken_pool = hasattr(method, 'broken_pool')
        for mark in getattr(method, 'pytestmark', []):
            if (mark.name == 'broken_pool'):
                expect_broken_pool = True
        is_actually_broken = (executor._flags.broken is not None)
        assert (is_actually_broken == expect_broken_pool)
        t_start = time.time()
        executor.shutdown(wait=True, kill_workers=True)
        dt = (time.time() - t_start)
        assert (dt < 10), 'Executor took too long to shutdown'
    _check_subprocesses_number(executor, 0)