Skip to content

Commit 4bed2e7

Browse files
committed
Fix deprecated pytest API
pytest-split uses deprecated API from pytest for hook implementation. Result of that is a warning message showed to user: ``` pytest_split/plugin.py:79: PytestDeprecationWarning: The hookimpl pytest_cmdline_main uses old-style configuration options (marks or attributes). Please use the pytest.hookimpl(tryfirst=True) decorator instead to configure the hooks. See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers @pytest.mark.tryfirst ```
1 parent 6af6da4 commit 4bed2e7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
## [Unreleased]
77
### Changed
88
- Introduce Ruff
9+
- Fixed usage of [deprecated pytest API](https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers)
10+
911

1012
## [0.8.0] - 2022-04-22
1113
### Fixed

src/pytest_split/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def pytest_addoption(parser: "Parser") -> None:
7676
)
7777

7878

79-
@pytest.mark.tryfirst()
79+
@pytest.hookimpl(tryfirst=True)
8080
def pytest_cmdline_main(config: "Config") -> "Optional[Union[int, ExitCode]]":
8181
"""
8282
Validate options.

0 commit comments

Comments
 (0)