-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Compatibility with black of the newest version of pytest ? #219
Comments
Hey Ludivine. Your question pertains primarily to
Perhaps you already knew that - but I wanted to share in case someone else reading this is unfamiliar with the landscape. The error you've encountered is due to There does appear to be a fork of pytest-black (https://github.com/insertjokehere/pytest-black-ng) that purports to have been created to continue maintenance, but that project, too, is stale. My projects also were affected by similar problems, and I decided to abandon black altogether in favor of ruff. Note that ruff does the work of several tools, including linting (like flake8/pylint), sorting imports (like isort), and formatting (like black), so adopting it might be a multi-phase effort (such as in my projects: jaraco/skeleton@d2ec047, jaraco/skeleton#99). The advantage is that you have an actively-maintained, fast, and popular tool that does all the work. I'd recommend it if you have the flexibility to adopt it. I hope that helps. Let me know if you have any other questions. |
Thank you for the detailed explanation and guidance. Your insights into the differences between the path libraries and the solution to the pytest-black issue are invaluable. Thank you also for the links and references you shared; they will be very useful for furthering my research. I appreciate the advice on switching to ruff and will consider it moving forward. I understand that Ruff is "necessary" for replacing the obsolete pytest-black module, but are you suggesting that pathlib is required for migrating from the also obsolete py.path, correct? Thanks again for your help! |
I have been utilizing the path.py library for managing file and directory paths in my Python projects. Recently, I have come across issues when executing tests using the newest versions of pytest.
The specific error encountered is:
ERROR test - pytest.PytestRemovedIn8Warning: The (fspath: py.path.local) argument to BlackItem is deprecated. Please use the (path: ... !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!
This indicates that pytest is phasing out py.path.local in favor of pathlib.Path. However, it is not entirely clear to me if this change necessitates that all path-related operations in my test suite should be converted to use pathlib.
Therefore, my question is: Is migrating to pathlib essential within the pytest testing framework, or is it merely a recommendation?
Additionally, I would like to know if os.path is intended to be compatible with pytest in the future, or if there are any planned changes for this library as well.
The text was updated successfully, but these errors were encountered: