def test_log_file_append_mode(self): |
logfilefn = tempdir.join('log_append.out') |
|
|
py.log.setconsumer("default", py.log.Path(logfilefn, append=True, |
buffering=0)) |
assert logfilefn.check() |
py.log.default("hello world #1") |
-> lines = logfilefn.readlines() |
assert lines == ['[default] hello world #1\n'] |
py.log.setconsumer("default", py.log.Path(logfilefn, append=True, |
buffering=0)) |
py.log.default("hello world #1") |
lines = logfilefn.readlines() |
assert lines == ['[default] hello world #1\n', |
'[default] hello world #1\n'] |