'L{reporter._AnsiColorizer.supported} returns C{False} if
C{curses.tigetnum} raises an error, and calls C{curses.setupterm} once.'

def test_supportedTigetNumErrors(self):

    class fakecurses(object, ):
        error = RuntimeError
        setUp = 0
        def setupterm(self):
            self.setUp += 1
        def tigetnum(self, value):
            raise self.error()
    sys.modules['curses'] = fakecurses()
    self.assertFalse(reporter._AnsiColorizer.supported(FakeStream()))
    self.assertEqual(sys.modules['curses'].setUp, 1)
