114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 | |
def test_log_file(self): |
custom_log = tempdir.join('log.out') |
-> py.log.setconsumer("default", open(str(custom_log), 'w', buffering=0)) |
py.log.default("hello world #1") |
assert custom_log.readlines() == ['[default] hello world #1\n'] |
|
py.log.setconsumer("default", py.log.Path(custom_log, buffering=0)) |
py.log.default("hello world #2") |
assert custom_log.readlines() == ['[default] hello world #2\n'] | |