Closed JonM0 closed 2 years ago
Thanks for the great issue report! Interesting that I wasn't hitting this issue on linux/macos.
Just merged and released as 2.2.1. Thanks again!
We're internally testing this flag on our end, but it's brand new so let us know if you run into anything else!
No problem, glad to help! This package is looking pretty good!
Describe the bug When running tests with pytest-xdist, using the flag --pmr-multiprocess-safe, the tests are executed correctly but
pytest_sessionfinish
throws an error:PermissionError: [WinError 32] The process cannot access the file because it is being used by another process
when trying to unlink pmr.json while holding its lock.Environment
[tool.poetry.dev-dependencies] pytest = "^7.0" pytest-xdist = "^2.5" pytest-mock-resources = { extras = ["postgres-binary"], version = "^2.2" } pywin32 = ">227"
Expected behavior No exception is raised and pmr.json is removed from the tmp folder.
Actual Behavior
Additional context I was able to fix it by tabbing left by 1 the call to
py fn.unlink()
in hooks.py, moving it outside the lockfile. Turning thisinto this