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

Method get

src/_pytest/stash.py:82–88  ·  view source on GitHub ↗

Get the value for key, or return default if the key wasn't set before.

(self, key: StashKey[T], default: D)

Source from the content-addressed store, hash-verified

80 return cast(T, self._storage[key])
81
82 def get(self, key: StashKey[T], default: D) -> Union[T, D]:
83 """Get the value for key, or return default if the key wasn't set
84 before."""
85 try:
86 return self[key]
87 except KeyError:
88 return default
89
90 def setdefault(self, key: StashKey[T], default: T) -> T:
91 """Return the value of key if already set, otherwise set the value

Callers 15

test_stashFunction · 0.95
get_issuesFunction · 0.45
record_xml_attributeFunction · 0.45
pytest_unconfigureFunction · 0.45
_argcomplete.pyFile · 0.45
formatMethod · 0.45
get_recordsMethod · 0.45
import_pathFunction · 0.45
evaluate_conditionFunction · 0.45
evaluate_skip_marksFunction · 0.45

Calls

no outgoing calls

Tested by 8

test_stashFunction · 0.76
parse_summary_nounsMethod · 0.36
popenMethod · 0.36
_check_all_skippedFunction · 0.36
assert_outcomesFunction · 0.36
collectMethod · 0.36
_prunetracebackMethod · 0.36