From 25f281ab5cd27ebaf096489cb52e25a9cc22e8ca Mon Sep 17 00:00:00 2001 From: Tuomas Suutari Date: Wed, 24 Jan 2024 13:15:15 +0200 Subject: [PATCH] Fix usage of deprecated startdir parameter Use the start_path parameter instead of startdir, since Pytest 7 yield the following deprecation warning if startdir is being used: site-packages/pytest_sugar.py:279: PytestRemovedIn8Warning: The (startdir: py.path.local) argument is deprecated, please use (start_path: pathlib.Path) Details of the Pytest deprecation can be found from: https://docs.pytest.org/en/latest/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path Fixes #232 --- pytest_sugar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest_sugar.py b/pytest_sugar.py index 81441f2..098f65a 100644 --- a/pytest_sugar.py +++ b/pytest_sugar.py @@ -277,7 +277,7 @@ def pytest_sessionstart(self, session: Session) -> None: bold=True, ) lines = self.config.hook.pytest_report_header( - config=self.config, startdir=self.startpath + config=self.config, start_path=self.startpath ) lines.reverse() for line in flatten(lines):