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

Method test_show_fixtures_conftest

testing/python/fixtures.py:3391–3415  ·  view source on GitHub ↗
(self, pytester: Pytester, testmod)

Source from the content-addressed store, hash-verified

3389
3390 @pytest.mark.parametrize("testmod", [True, False])
3391 def test_show_fixtures_conftest(self, pytester: Pytester, testmod) -> None:
3392 pytester.makeconftest(
3393 '''
3394 import pytest
3395 @pytest.fixture
3396 def arg1():
3397 """ hello world """
3398 '''
3399 )
3400 if testmod:
3401 pytester.makepyfile(
3402 """
3403 def test_hello():
3404 pass
3405 """
3406 )
3407 result = pytester.runpytest("--fixtures")
3408 result.stdout.fnmatch_lines(
3409 """
3410 *tmp_path*
3411 *fixtures defined from*conftest*
3412 *arg1*
3413 *hello world*
3414 """
3415 )
3416
3417 def test_show_fixtures_trimmed_doc(self, pytester: Pytester) -> None:
3418 p = pytester.makepyfile(

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
makeconftestMethod · 0.45
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected