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

Method test_scope_mismatch

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

Source from the content-addressed store, hash-verified

2547 assert "c" in values
2548
2549 def test_scope_mismatch(self, pytester: Pytester) -> None:
2550 pytester.makeconftest(
2551 """
2552 import pytest
2553 @pytest.fixture(scope="function")
2554 def arg(request):
2555 pass
2556 """
2557 )
2558 pytester.makepyfile(
2559 """
2560 import pytest
2561 @pytest.fixture(scope="session")
2562 def arg(arg):
2563 pass
2564 def test_mismatch(arg):
2565 pass
2566 """
2567 )
2568 result = pytester.runpytest()
2569 result.stdout.fnmatch_lines(["*ScopeMismatch*", "*1 error*"])
2570
2571 def test_parametrize_separated_order(self, pytester: Pytester) -> None:
2572 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