Return fixturemarker or None if it doesn't exist or raised exceptions.
(obj: object)
| 223 | |
| 224 | |
| 225 | def 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. |
no outgoing calls