Skip to content

artifacts_folder.cleanup() raises PermissionError: [WinError 32] #163

@geiregjo

Description

@geiregjo

Context:
Playwright Version: 1.31.1
Pytest Version: 7.2.0
Pytest Playwright Version: 0.3.2
Operating System: Windows
Python version: Python 3.10
Browser: Chromium

Describe the bug
Sometimes, when Pytest is cleaning up the artifacts a PermissionError is raised. It seems that the .webm file in artifacts_folder is still in use by another process. Currently I don't know how to reproduce the issue.

Before, I thought that this issue was caused by Pytest Parallel.

From Python 3.10 cleanup errors can easily be ignored using the TemporaryDirectory ignore_cleanup_errors kwarg. Not sure how to handle it in lower Python versions?

Stacktrace
Note that a NotADirectoryError is raised instead of a PermissionError. This is caused by an issue in cpython.

stacktrace.txt

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions