'L{reporter._AnsiColorizer.supported} returns C{True} if
C{curses.tigetnum} returns more than 2 supported colors. It only tries
to call C{curses.setupterm} if C{curses.tigetnum} previously failed
with a C{curses.error}.'

def test_supportedSetupTerm(self):

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