def test_cleanUpThreadPoolEvenBeforeReactorIsRun(self):
        """
        When the reactor has its shutdown event fired before it is run, the
        thread pool is completely destroyed.

        For what it's worth, the reason we support this behavior at all is
        because Trial does this.

        This is the case of the thread pool being created without the reactor
        being started at al.
        """
        reactor = self.buildReactor()
        threadPoolRef = ref(reactor.getThreadPool())
        reactor.fireSystemEvent("shutdown")

        if reactor.__class__.__name__ == "AsyncioSelectorReactor":
            self.assertIsNone(reactor.threadpool)
            # ReactorBase.__init__ sets self.crash as a 'shutdown'
            # event, which in turn calls stop on the underlying
            # asyncio event loop, which in turn sets a _stopping
            # attribute on it that's only unset after an iteration of
            # the loop.  Subsequent tests can only reuse the asyncio
            # loop if it's allowed to run and unset that _stopping
            # attribute.
            self.runReactor(reactor)
        else:
            gc.collect()
            self.assertIsNone(threadPoolRef())

        When the reactor has its shutdown event fired before it is run, the
        thread pool is completely destroyed.

        For what it's worth, the reason we support this behavior at all is
        because Trial does this.

        This is the case of the thread pool being created without the reactor
        being started at al.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_threads.py