Skip to content

Commit

Permalink
Also pospone deprecation of FILLFUNCARGS, PYTEST_COLLECT_MODULE and W…
Browse files Browse the repository at this point in the history
…ARNING_CAPTURED_HOOK
  • Loading branch information
nicoddemus committed Jul 11, 2020
1 parent 1185a2b commit d134e76
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/_pytest/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
from _pytest.config import _PluggyPlugin
from _pytest.config import Config
from _pytest.config.argparsing import Parser
from _pytest.deprecated import FILLFUNCARGS
from _pytest.deprecated import FIXTURE_POSITIONAL_ARGUMENTS
from _pytest.deprecated import FUNCARGNAMES
from _pytest.mark import ParameterSet
Expand Down Expand Up @@ -361,7 +360,8 @@ def reorder_items_atscope(

def fillfixtures(function: "Function") -> None:
""" fill missing funcargs for a test function. """
warnings.warn(FILLFUNCARGS, stacklevel=2)
# Uncomment this after 6.0 release (#7361)
# warnings.warn(FILLFUNCARGS, stacklevel=2)
try:
request = function._request
except AttributeError:
Expand Down
5 changes: 3 additions & 2 deletions src/_pytest/hookspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from pluggy import HookspecMarker

from .deprecated import COLLECT_DIRECTORY_HOOK
from .deprecated import WARNING_CAPTURED_HOOK
from _pytest.compat import TYPE_CHECKING

if TYPE_CHECKING:
Expand Down Expand Up @@ -738,7 +737,9 @@ def pytest_terminal_summary(
"""


@hookspec(historic=True, warn_on_impl=WARNING_CAPTURED_HOOK)
# Uncomment this after 6.0 release (#7361)
# @hookspec(historic=True, warn_on_impl=WARNING_CAPTURED_HOOK)
@hookspec(historic=True)
def pytest_warning_captured(
warning_message: "warnings.WarningMessage",
when: "Literal['config', 'collect', 'runtest']",
Expand Down
5 changes: 2 additions & 3 deletions src/pytest/collect.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import sys
import warnings
from types import ModuleType
from typing import Any
from typing import List

import pytest
from _pytest.deprecated import PYTEST_COLLECT_MODULE


COLLECT_FAKEMODULE_ATTRIBUTES = [
Expand Down Expand Up @@ -33,7 +31,8 @@ def __dir__(self) -> List[str]:
def __getattr__(self, name: str) -> Any:
if name not in self.__all__:
raise AttributeError(name)
warnings.warn(PYTEST_COLLECT_MODULE.format(name=name), stacklevel=2)
# Uncomment this after 6.0 release (#7361)
# warnings.warn(PYTEST_COLLECT_MODULE.format(name=name), stacklevel=2)
return getattr(pytest, name)


Expand Down
4 changes: 3 additions & 1 deletion testing/deprecated_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def test():
)


@pytest.mark.skip(reason="should be reintroduced in 6.1: #7361")
@pytest.mark.parametrize("attribute", pytest.collect.__all__) # type: ignore
# false positive due to dynamic attribute
def test_pytest_collect_module_deprecated(attribute):
Expand Down Expand Up @@ -117,7 +118,8 @@ class MockConfig:
assert w[0].filename == __file__


def test__fillfuncargs_is_deprecated() -> None:
@pytest.mark.skip(reason="should be reintroduced in 6.1: #7361")
def test_fillfuncargs_is_deprecated() -> None:
with pytest.warns(
pytest.PytestDeprecationWarning,
match="The `_fillfuncargs` function is deprecated",
Expand Down

0 comments on commit d134e76

Please sign in to comment.