Skip to content

Commit 92163c9

Browse files
committed
data: default to None
If the data is not set, it will raise an exception here. The stash key may not be created if an exception occurs during modifyitems hook, which now can happen if preferred_topology marker gets incorrect arguments.
1 parent 6378d39 commit 92163c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytest_mh/_private/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def SetData(item: pytest.Item, data: MultihostItemData | None) -> None:
5454

5555
@staticmethod
5656
def GetData(item: pytest.Item) -> MultihostItemData | None:
57-
return item.stash[DataStashKey]
57+
return item.stash.get(DataStashKey, None)
5858

5959

6060
DataStashKey = pytest.StashKey[MultihostItemData | None]()

0 commit comments

Comments
 (0)