MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_plugin_skip

Method test_plugin_skip

testing/test_pluginmanager.py:274–287  ·  view source on GitHub ↗
(self, pytester: Pytester, monkeypatch: MonkeyPatch)

Source from the content-addressed store, hash-verified

272
273 @pytest.mark.filterwarnings("always")
274 def test_plugin_skip(self, pytester: Pytester, monkeypatch: MonkeyPatch) -> None:
275 p = pytester.makepyfile(
276 skipping1="""
277 import pytest
278 pytest.skip("hello", allow_module_level=True)
279 """
280 )
281 shutil.copy(p, p.with_name("skipping2.py"))
282 monkeypatch.setenv("PYTEST_PLUGINS", "skipping2")
283 result = pytester.runpytest("-p", "skipping1", syspathinsert=True)
284 assert result.ret == ExitCode.NO_TESTS_COLLECTED
285 result.stdout.fnmatch_lines(
286 ["*skipped plugin*skipping1*hello*", "*skipped plugin*skipping2*hello*"]
287 )
288
289 def test_consider_env_plugin_instantiation(
290 self,

Callers

nothing calls this directly

Calls 4

setenvMethod · 0.80
fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected