Skip to content

Commit

Permalink
FIXUP: rebase issues and typing
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Mar 6, 2022
1 parent d10bb98 commit fd9650d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions extra/setup-py.test/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys

from distutils.core import setup

if __name__ == "__main__":
Expand Down
6 changes: 3 additions & 3 deletions src/_pytest/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def _get_directory(path: Path) -> Path:


def _get_legacy_hook_marks(
method: FunctionType,
method: object, # using object to avoid function type excess
hook_type: str,
opt_names: Tuple[str, ...],
) -> Dict[str, bool]:
Expand All @@ -359,10 +359,10 @@ def _get_legacy_hook_marks(
hook_opts = ", ".join(f"{name}=True" for name, val in opts.items() if val)
message = _pytest.deprecated.HOOK_LEGACY_MARKING.format(
type=hook_type,
fullname=method.__qualname__,
fullname=method.__qualname__, # type: ignore
hook_opts=hook_opts,
)
warn_explicit_for(method, message)
warn_explicit_for(cast(FunctionType, method), message)
return opts


Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
INSTANCE_COLLECTOR = PytestRemovedIn8Warning(
"The pytest.Instance collector type is deprecated and is no longer used. "
"See https://docs.pytest.org/en/latest/deprecations.html#the-pytest-instance-collector",

)
HOOK_LEGACY_MARKING = UnformattedWarning(
PytestDeprecationWarning,
"The hook{type} {fullname} uses old-style configuration options (marks or attributes).\n"
Expand Down
1 change: 0 additions & 1 deletion testing/test_recwarn.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import warnings
from typing import Optional

Expand Down

0 comments on commit fd9650d

Please sign in to comment.