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

Method test_invalid_scope

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

Source from the content-addressed store, hash-verified

1264 )
1265
1266 def test_invalid_scope(self, pytester: Pytester) -> None:
1267 pytester.makepyfile(
1268 """
1269 import pytest
1270 @pytest.fixture(scope="functions")
1271 def badscope():
1272 pass
1273
1274 def test_nothing(badscope):
1275 pass
1276 """
1277 )
1278 result = pytester.runpytest_inprocess()
1279 result.stdout.fnmatch_lines(
1280 "*Fixture 'badscope' from test_invalid_scope.py got an unexpected scope value 'functions'"
1281 )
1282
1283 @pytest.mark.parametrize("scope", ["function", "session"])
1284 def test_parameters_without_eq_semantics(self, scope, pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytest_inprocessMethod · 0.45

Tested by

no test coverage detected