def test_supportedTigetNumWrongError(self):
        """
        L{reporter._AnsiColorizer.supported} returns C{False} and doesn't try
        to call C{curses.setupterm} if C{curses.tigetnum} returns something
        different than C{curses.error}.
        """
        class fakecurses(object):
            error = RuntimeError

            def tigetnum(self, value):
                raise ValueError()

        sys.modules['curses'] = fakecurses()
        self.assertFalse(reporter._AnsiColorizer.supported(FakeStream()))

        L{reporter._AnsiColorizer.supported} returns C{False} and doesn't try
        to call C{curses.setupterm} if C{curses.tigetnum} returns something
        different than C{curses.error}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_reporter.py