FIX: Type

This commit is contained in:
Eric Larson 2024-07-02 18:30:40 -04:00
parent cfe8ae0647
commit ee97c98d39
2 changed files with 3 additions and 2 deletions

View File

@ -13,6 +13,7 @@ from __future__ import annotations
import inspect import inspect
from pathlib import Path from pathlib import Path
from typing import Any
from warnings import warn from warnings import warn
from warnings import warn_explicit from warnings import warn_explicit
@ -94,7 +95,7 @@ def check_ispytest(ispytest: bool) -> None:
warn(PRIVATE, stacklevel=3) warn(PRIVATE, stacklevel=3)
def _warn_auto_stacklevel(message, category=UserWarning): def _warn_auto_stacklevel(message: Warning | str, category: Any = UserWarning) -> None:
"""Emit a warning with trace outside the pytest namespace.""" """Emit a warning with trace outside the pytest namespace."""
root_dir = Path(__file__).parents[1] root_dir = Path(__file__).parents[1]
frame = inspect.currentframe() frame = inspect.currentframe()

View File

@ -196,7 +196,7 @@ def test_fixture_disallow_on_marked_functions():
@pytest.mark.parametrize("example", ["hello"]) @pytest.mark.parametrize("example", ["hello"])
@pytest.fixture @pytest.fixture
def foo(): def bar():
raise NotImplementedError() raise NotImplementedError()
assert len(record) == 1 assert len(record) == 1