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

Function test_pytest_plugins_as_module

testing/acceptance_test.py:993–1004  ·  view source on GitHub ↗

Do not raise an error if pytest_plugins attribute is a module (#3899)

(pytester: Pytester)

Source from the content-addressed store, hash-verified

991
992
993def test_pytest_plugins_as_module(pytester: Pytester) -> None:
994 """Do not raise an error if pytest_plugins attribute is a module (#3899)"""
995 pytester.makepyfile(
996 **{
997 "__init__.py": "",
998 "pytest_plugins.py": "",
999 "conftest.py": "from . import pytest_plugins",
1000 "test_foo.py": "def test(): pass",
1001 }
1002 )
1003 result = pytester.runpytest()
1004 result.stdout.fnmatch_lines(["* 1 passed in *"])
1005
1006
1007def test_deferred_hook_checking(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected