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

Function getfixturemarker

src/_pytest/fixtures.py:225–236  ·  view source on GitHub ↗

Return fixturemarker or None if it doesn't exist or raised exceptions.

(obj: object)

Source from the content-addressed store, hash-verified

223
224
225def getfixturemarker(obj: object) -> Optional["FixtureFunctionMarker"]:
226 """Return fixturemarker or None if it doesn't exist or raised
227 exceptions."""
228 try:
229 fixturemarker: Optional[FixtureFunctionMarker] = getattr(
230 obj, "_pytestfixturefunction", None
231 )
232 except TEST_OUTCOME:
233 # some objects raise errors like request (from flask import request)
234 # we don't expect them to be fixture functions
235 return None
236 return fixturemarker
237
238
239# Parametrized fixture key, helper alias for code below.

Callers 3

call_optionalFunction · 0.90
parsefactoriesMethod · 0.85

Calls

no outgoing calls

Tested by 1