Skip to content

tests: Use tmp_path fixture #362

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

Merged
merged 4 commits into from
Jan 6, 2023
Merged

tests: Use tmp_path fixture #362

merged 4 commits into from
Jan 6, 2023

Conversation

martin-kokos
Copy link
Contributor

@martin-kokos martin-kokos commented Dec 28, 2022

Using the tmp_path pytest fixture fixes permission errors when running tests inside a sandbox,
https://docs.pytest.org/en/6.2.x/tmpdir.html

FAILED test_command.py::TestCommands::test_deeppatch_command[t1.json-t2.json-args0-0] - PermissionError: [Errno 13] Permission denied: '/tmp/t1.json'
FAILED test_command.py::TestCommands::test_deeppatch_command[t1_corrupt.json-t2.json-args1-1] - PermissionError: [Errno 13] Permission denied: '/tmp/t1_corrupt.json'
FAILED test_command.py::TestCommands::test_deeppatch_command[t1.json-t2_json.csv-args2-0] - PermissionError: [Errno 13] Permission denied: '/tmp/t1.json'
FAILED test_command.py::TestCommands::test_deeppatch_command[t2_json.csv-t1.json-args3-0] - PermissionError: [Errno 13] Permission denied: '/tmp/delta.pickle'
FAILED test_command.py::TestCommands::test_deeppatch_command[t1.csv-t2.csv-args4-0] - PermissionError: [Errno 13] Permission denied: '/tmp/delta.pickle'
FAILED test_command.py::TestCommands::test_deeppatch_command[t1.toml-t2.toml-args5-0] - PermissionError: [Errno 13] Permission denied: '/tmp/delta.pickle'
FAILED test_command.py::TestCommands::test_deeppatch_command[t1.pickle-t2.pickle-args6-0] - PermissionError: [Errno 13] Permission denied: '/tmp/delta.pickle'
FAILED test_command.py::TestCommands::test_deeppatch_command[t1.yaml-t2.yaml-args7-0] - PermissionError: [Errno 13] Permission denied: '/tmp/delta.pickle'

@seperman seperman changed the base branch from master to dev January 6, 2023 04:38
@seperman
Copy link
Owner

seperman commented Jan 6, 2023

@martin-kokos Cool. I was not aware of the tmp_path fixture.
What kind of sandbox do you run?

@seperman seperman merged commit d3cf40b into seperman:dev Jan 6, 2023
@seperman
Copy link
Owner

seperman commented Jan 6, 2023

I just released DeepDiff 6.2.3 which includes your code too.

@martin-kokos
Copy link
Contributor Author

martin-kokos commented Jan 6, 2023

Thanks. I'd like to add deepdiff as a package to Gentoo Linux because it is a dependency of poetry. Gentoo's package manager portage builds packages inside a sandbox which doesn't allow operations outside of the build directory itself. Portage also relies on the manifest to populate the sandbox, hence the manifest fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants