-
Notifications
You must be signed in to change notification settings - Fork 169
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
Use tmp_path instead of tmpdir pytest fixture #8311
Comments
This issue is tracked on JIRA as JP-3552. |
Comment by Ned Molter on JIRA: for doctests, following example from Astropy: pytest discussion question from pllim |
Comment by Ned Molter on JIRA: The use of "-p no:legacypath" currently causes failures when running tests with both the GitHub Action and Jenkins that are due to the dependency on ci_watson. ci_watson was updated 4 days ago to remove instances of "tmpdir" and use "-p no:legacypath" but a release has not yet been published. Brett Graham mentioned that ci_watson is little maintained and could possibly be replaced in the future. He suggested two possible paths forward:
Does anyone have opinions on which of these is the preferred option? |
Comment by Tyler Pauly on JIRA: I don't know much about All this to say - it may make sense to ask Joe Hunkeler or Zach Burnett, as the choice is probably weighted most heavily by the future of our test architecture. |
Comment by Joe Hunkeler on JIRA: Repositories that deal with input data and "truth" files for testing use ci_watson to generate Artifactory "spec" files. When a test failure occurs pytest's basetemp contains the (potential truth) files. These paths are recorded in a JSON config. Jenkins uses an Artifactory plugin to process the configs, but honestly, it's equivalent to running this in an Action: find $PATH_TO_PYTEST_BASETEMP -type -name 'result_*.json' | xargs -I '{}' jf rt u --spec '{}' |
I would drop the use of Making a |
Comment by Ned Molter on JIRA: Ok, thanks both of you! The tmp_cwd fixture is basically the same as the function_jail that Roman implemented, but I'm going to use tmp_cwd because I think the name is more descriptive. And thanks for the clarification about how those two uses of ci_watson are independent, I agree it is beyond the scope of this ticket (if even desired at present) to replace the artifactory interface tools |
There's also a module-scoped pytest fixture called Lines 54 to 69 in 911b5c6
which is used extensively in the regression tests, and it would be worthwhile changing that one to use |
Comment by Ned Molter on JIRA: Thanks, yep, I already updated that one |
Comment by Howard Bushouse on JIRA: Fixed by #8327 |
Replace all instances
tmpdir
andtmpdir_factory
pytest fixtures withtmp_path
andtmp_path_factory
fixtures, respectively.Then in pyproject.toml:
which will prevent it from being used in the future. This is will make the code more robust for use of
pathlib.Path
instances in the runtime code.The text was updated successfully, but these errors were encountered: