Пример #1
0
    def factory(modes=None):
        p = patch('tempfile.mkstemp', lambda prefix:
                  ('fd', str(temp_log_file)))
        p.start()
        patchers.append(p)

        if modes is not None:
            p = patch.object(_MessageHandler, '_modes', modes)
            p.start()
            patchers.append(p)

        return _MessageHandler()
Пример #2
0
    def factory(modes=None):
        p = patch('tempfile.mkstemp', lambda prefix: ('fd', str(temp_log_file)))
        p.start()
        patchers.append(p)

        if modes is not None:
            if 'verbose' not in modes:
                # verbose should always be there, as it's used internally
                modes['verbose'] = (10, "%(message)s")
            p = patch.object(_MessageHandler, '_modes', modes)
            p.start()
            patchers.append(p)

        return _MessageHandler()
Пример #3
0
    def factory(modes=None):
        p = patch("tempfile.mkstemp", lambda prefix:
                  ("fd", str(temp_log_file)))
        p.start()
        patchers.append(p)

        if modes is not None:
            if "verbose" not in modes:
                # verbose should always be there, as it's used internally
                modes["verbose"] = (10, "%(message)s")
            p = patch.object(_MessageHandler, "_modes", modes)
            p.start()
            patchers.append(p)

        return _MessageHandler()
Пример #4
0
    def factory(modes=None):
        p = patch("tempfile.mkstemp", lambda prefix: ("fd", str(temp_log_file)))
        p.start()
        patchers.append(p)

        return _MessageHandler()