MCPcopy
hub / github.com/pytest-dev/pytest / get

Method get

src/_pytest/stash.py:86–92  ·  src/_pytest/stash.py::Stash.get

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

84 return cast(T, self._storage[key])
85
86 def get(self, key: StashKey[T], default: D) -> T | D:
87 class="st">"""Get the value for key, or return default if the key wasn&class="cm">#x27;t set
88 before.class="st">"""
89 try:
90 return self[key]
91 except KeyError:
92 return default
93
94 def setdefault(self, key: StashKey[T], default: T) -> T:
95 class="st">"""Return the value of key if already set, otherwise set the value

Callers 15

test_stashFunction · 0.95
get_issuesFunction · 0.45
cleanupFunction · 0.45
pytest_unconfigureFunction · 0.45
record_xml_attributeFunction · 0.45
pytest_unconfigureFunction · 0.45
_argcomplete.pyFile · 0.45
formatMethod · 0.45
get_recordsMethod · 0.45

Calls

no outgoing calls

Tested by 9

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