FawltyDeps
FawltyDeps copied to clipboard
Refactor `run_fawltydeps_function` to use `chdir` fixture
Following @jherland's comment #271:
I'm a little worried about these changes. As I understand it, where
run_fawltydeps()
can use thecwd
to actually set the current working directory for the subprocess,run_fawltydeps_functon()
cannot do the same, since everything happens in the same process. Instead, you work around that by passingcwd
as abasepath
/positional argument instead, and the consequence of that is to adjust the expected output here.I would like to keep test coverage of the fact that when we work on paths relative to cwd, then that is reflected in the output.
I wonder if we can use
monkeypatch.chdir
to temporarily change cwd while running the tests? However, it probably means changingrun_fawltydeps_function()
into a pytest fixture (to have access tomonkeypatch
).Alternatively, kick this to a later PR, and leave it as
run_fawltydeps()
instead ofrun_fawltydeps_function()
for now.