python/elasticsearch: update to 8.16.0
[oi-userland.git] / components / python / pytest / patches / 03-consider_entry_points.patch
blob3aa9e79eb6004c561ef042a8c6c6a92aee196f96
1 https://github.com/pytest-dev/pytest/pull/12616
3 --- pytest-8.3.3/src/_pytest/config/__init__.py.orig
4 +++ pytest-8.3.3/src/_pytest/config/__init__.py
5 @@ -828,7 +828,7 @@
6 ) -> None:
7 plugins = _get_plugin_specs_as_list(spec)
8 for import_spec in plugins:
9 - self.import_plugin(import_spec)
10 + self.import_plugin(import_spec, consider_entry_points=True)
12 def import_plugin(self, modname: str, consider_entry_points: bool = False) -> None:
13 """Import a plugin with ``modname``.
14 --- pytest-8.3.3/testing/test_assertion.py.orig
15 +++ pytest-8.3.3/testing/test_assertion.py
16 @@ -222,6 +222,7 @@
17 self, pytester: Pytester, mode, monkeypatch
18 ) -> None:
19 monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
20 + monkeypatch.delenv("PYTEST_PLUGINS", raising=False)
21 # Make sure the hook is installed early enough so that plugins
22 # installed via distribution package are rewritten.
23 pytester.mkdir("hampkg")
24 --- pytest-8.3.3/testing/test_config.py.orig
25 +++ pytest-8.3.3/testing/test_config.py
26 @@ -503,6 +503,7 @@
28 monkeypatch.setattr(importlib.metadata, "distributions", my_dists)
29 monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
30 + monkeypatch.delenv("PYTEST_PLUGINS", raising=False)
32 pytester.makeini(ini_file_text)
34 @@ -1143,6 +1144,7 @@
35 ) -> None:
36 """Integration test for broken distributions with 'files' metadata being None (#5389)"""
37 monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
38 + monkeypatch.delenv("PYTEST_PLUGINS", raising=False)
40 class DummyEntryPoint:
41 name = "mytestplugin"
42 @@ -1169,6 +1171,7 @@
43 pytester: Pytester, monkeypatch: MonkeyPatch, block_it: bool
44 ) -> None:
45 monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
46 + monkeypatch.delenv("PYTEST_PLUGINS", raising=False)
48 plugin_module_placeholder = object()
50 @@ -1237,6 +1240,7 @@
51 return (Distribution(),)
53 monkeypatch.setenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", "1")
54 + monkeypatch.delenv("PYTEST_PLUGINS", raising=False)
55 monkeypatch.setattr(importlib.metadata, "distributions", distributions)
56 monkeypatch.setitem(sys.modules, "mytestplugin", PseudoPlugin())
57 config = pytester.parseconfig(*parse_args)
58 --- pytest-8.3.3/testing/test_helpconfig.py.orig
59 +++ pytest-8.3.3/testing/test_helpconfig.py
60 @@ -64,7 +64,7 @@
64 -def test_empty_help_param(pytester: Pytester) -> None:
65 +def test_empty_help_param(pytester: Pytester, monkeypatch) -> None:
66 """Test that an empty help param is displayed correctly."""
67 pytester.makeconftest(
68 """
69 @@ -72,6 +72,7 @@
70 parser.addini("test_ini", "", default=True, type="bool")
71 """
73 + monkeypatch.delenv("PYTEST_PLUGINS", raising=False)
74 result = pytester.runpytest("--help")
75 assert result.ret == 0
76 lines = [