log tests use tmpdir properly
This commit is contained in:
parent
0bb1eb32f2
commit
b98fc48273
@ -32,6 +32,7 @@
|
||||
def test_log_python_output_with_python_stream(capsys, tmpdir):
|
||||
# pytest's DontReadFromInput object does not like what we do here, so
|
||||
# disable capsys or things hang.
|
||||
with tmpdir.as_cwd():
|
||||
with capsys.disabled():
|
||||
with log_output('foo.txt'):
|
||||
print('logged')
|
||||
@ -43,6 +44,7 @@ def test_log_python_output_with_python_stream(capsys, tmpdir):
|
||||
|
||||
|
||||
def test_log_python_output_with_fd_stream(capfd, tmpdir):
|
||||
with tmpdir.as_cwd():
|
||||
with log_output('foo.txt'):
|
||||
print('logged')
|
||||
|
||||
@ -53,6 +55,7 @@ def test_log_python_output_with_fd_stream(capfd, tmpdir):
|
||||
|
||||
|
||||
def test_log_python_output_and_echo_output(capfd, tmpdir):
|
||||
with tmpdir.as_cwd():
|
||||
with log_output('foo.txt') as logger:
|
||||
with logger.force_echo():
|
||||
print('echo')
|
||||
@ -72,6 +75,7 @@ def test_log_subproc_output(capsys, tmpdir):
|
||||
# TODO: figure out why this is and whether it means we're doing
|
||||
# sometihng wrong with OUR redirects. Seems like it should work even
|
||||
# with capsys enabled.
|
||||
with tmpdir.as_cwd():
|
||||
with capsys.disabled():
|
||||
with log_output('foo.txt'):
|
||||
echo('logged')
|
||||
@ -84,6 +88,7 @@ def test_log_subproc_output(capsys, tmpdir):
|
||||
def test_log_subproc_and_echo_output(capfd, tmpdir):
|
||||
echo = which('echo')
|
||||
|
||||
with tmpdir.as_cwd():
|
||||
with log_output('foo.txt') as logger:
|
||||
with logger.force_echo():
|
||||
echo('echo')
|
||||
|
Loading…
Reference in New Issue
Block a user