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

Method test_funcarg

testing/python/fixtures.py:3251–3270  ·  view source on GitHub ↗
(self, pytester: Pytester, scope, ok, error)

Source from the content-addressed store, hash-verified

3249 reprec.assertoutcome(passed=1)
3250
3251 def test_funcarg(self, pytester: Pytester, scope, ok, error) -> None:
3252 pytester.makepyfile(
3253 """
3254 import pytest
3255 @pytest.fixture(scope=%r)
3256 def arg(request):
3257 for x in %r:
3258 assert hasattr(request, x)
3259 for x in %r:
3260 pytest.raises(AttributeError, lambda:
3261 getattr(request, x))
3262 assert request.session
3263 assert request.config
3264 def test_func(arg):
3265 pass
3266 """
3267 % (scope, ok.split(), error.split())
3268 )
3269 reprec = pytester.inline_run()
3270 reprec.assertoutcome(passed=1)
3271
3272
3273class TestErrors:

Callers

nothing calls this directly

Calls 3

assertoutcomeMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected