Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions testing/acceptance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import sys
import types

import setuptools

from _pytest.config import ExitCode
from _pytest.pathlib import symlink_or_skip
from _pytest.pytester import Pytester
Expand Down Expand Up @@ -722,10 +724,14 @@ def test_cmdline_python_package(self, pytester: Pytester, monkeypatch) -> None:
assert result.ret != 0
result.stderr.fnmatch_lines(["*not*found*test_missing*"])

def test_cmdline_python_namespace_package(
@pytest.mark.skipif(
int(setuptools.__version__.split(".")[0]) >= 80,
reason="modern setuptools removing pkg_resources",
)
def test_cmdline_python_legacy_namespace_package(
self, pytester: Pytester, monkeypatch
) -> None:
"""Test --pyargs option with namespace packages (#1567).
"""Test --pyargs option with legacy namespace packages (#1567).

Ref: https://packaging.python.org/guides/packaging-namespace-packages/
"""
Expand Down
6 changes: 6 additions & 0 deletions testing/test_monkeypatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import sys
import textwrap

import setuptools

from _pytest.monkeypatch import MonkeyPatch
from _pytest.pytester import Pytester
import pytest
Expand Down Expand Up @@ -429,6 +431,10 @@ class A:


@pytest.mark.filterwarnings(r"ignore:.*\bpkg_resources\b:DeprecationWarning")
@pytest.mark.skipif(
int(setuptools.__version__.split(".")[0]) >= 80,
reason="modern setuptools removing pkg_resources",
)
def test_syspath_prepend_with_namespace_packages(
pytester: Pytester, monkeypatch: MonkeyPatch
) -> None:
Expand Down