Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish MonkeyPatch for typing #7453

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/_pytest/monkeypatch.py
Expand Up @@ -13,10 +13,10 @@
from typing import TypeVar
from typing import Union

import pytest
from _pytest.compat import overload
from _pytest.fixtures import fixture
from _pytest.pathlib import Path
from _pytest.warning_types import PytestWarning

RE_IMPORT_ERROR_NAME = re.compile(r"^No module named (.*)$")

Expand Down Expand Up @@ -272,7 +272,7 @@ def setenv(self, name: str, value: str, prepend: Optional[str] = None) -> None:
and prepend the ``value`` adjoined with the ``prepend`` character."""
if not isinstance(value, str):
warnings.warn(
pytest.PytestWarning(
PytestWarning(
"Value of environment variable {name} type should be str, but got "
"{value!r} (type: {type}); converted to str implicitly".format(
name=name, value=value, type=type(value).__name__
Expand Down
2 changes: 2 additions & 0 deletions src/pytest/__init__.py
Expand Up @@ -21,6 +21,7 @@
from _pytest.main import Session
from _pytest.mark import MARK_GEN as mark
from _pytest.mark import param
from _pytest.monkeypatch import MonkeyPatch
from _pytest.nodes import Collector
from _pytest.nodes import File
from _pytest.nodes import Item
Expand Down Expand Up @@ -76,6 +77,7 @@
"main",
"mark",
"Module",
"MonkeyPatch",
"Package",
"param",
"PytestAssertRewriteWarning",
Expand Down