예제 #1
0
파일: test.py 프로젝트: wolever/pprintpp
 def test_fmt(self):
     print(pp.pformat("asdf"))
     print(pp.fmt("stuff"))
     self.assertStdout("""
         'asdf'
         'stuff'
     """)
예제 #2
0
 def test_fmt(self):
     print(pp.pformat("asdf"))
     print(pp.fmt("stuff"))
     self.assertStdout("""
         'asdf'
         'stuff'
     """)
예제 #3
0
파일: logging.py 프로젝트: absortium/core
    def decorator(msg, *args, **kwargs):
        pretty_msg = "Func:  %s\n" % get_prev_method_name()

        if type(msg) == str:
            pretty_msg += msg
        else:
            pretty_msg += pp.fmt(msg)
        pretty_msg += "\n+ " + "- " * 30 + "+\n"

        func(pretty_msg, *args, **kwargs)
예제 #4
0
    def decorator(msg, *args, **kwargs):
        pretty_msg = "Func:  %s\n" % get_prev_method_name()

        if type(msg) == str:
            pretty_msg += msg
        else:
            pretty_msg += pp.fmt(msg)
        pretty_msg += "\n+ " + "- " * 30 + "+\n"

        func(pretty_msg, *args, **kwargs)
예제 #5
0
파일: test.py 프로젝트: ahawker/pprintpp
import pp

pp(["hello", "world"])

pp.pprint("stuff")

print pp.pformat("asdf")

print pp.fmt("stuff")

print dir(pp)

print repr(pp)
예제 #6
0
 def cmd_expect(self, expected):
     actual = pp.fmt(self.cmd_result())
     # expected = repr(' '.join(parts))
     if actual != expected:
         raise RuntimeError('Expected {!r}, got {!r}'.format(
             expected, actual))