Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor run_fawltydeps_function to use chdir fixture #302

Open
mknorps opened this issue Apr 12, 2023 · 0 comments
Open

Refactor run_fawltydeps_function to use chdir fixture #302

mknorps opened this issue Apr 12, 2023 · 0 comments
Labels
P3 minor: not priorized type: refactoring

Comments

@mknorps
Copy link
Collaborator

mknorps commented Apr 12, 2023

Following @jherland's comment #271:

I'm a little worried about these changes. As I understand it, where run_fawltydeps() can use the cwd 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 passing cwd as a basepath/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 changing run_fawltydeps_function() into a pytest fixture (to have access to monkeypatch).

Alternatively, kick this to a later PR, and leave it as run_fawltydeps() instead of run_fawltydeps_function() for now.

@mknorps mknorps changed the title Refactor of run_fawltydeps_function to use chdir fixture Refactor run_fawltydeps_function to use chdir fixture Apr 12, 2023
@Nour-Mws Nour-Mws added the P3 minor: not priorized label Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 minor: not priorized type: refactoring
Projects
None yet
Development

No branches or pull requests

2 participants