Skip to content

Commit

Permalink
Fix usage of deprecated startdir parameter
Browse files Browse the repository at this point in the history
Use the start_path paramater 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
  • Loading branch information
suutari-ai committed Jan 24, 2024
1 parent bcfb953 commit 30ac704
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytest_sugar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 30ac704

Please sign in to comment.