Skip to content

Commit 7a450fe

Browse files
author
Adam Dyess
authored
fix: cloud entries in an dictionary were being deleted while iterating the object (#155)
1 parent 7914f68 commit 7a450fe

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

pytest_operator/plugin.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,12 +1089,11 @@ async def _destroy(entity_name: str, **kwargs):
10891089
async def _cleanup_models(self):
10901090
# remove clouds from most recently made, to first made
10911091
# each model in the cloud will be forgotten
1092-
for cloud in reversed(self._clouds):
1092+
for cloud in list(reversed(self._clouds)):
10931093
await self.forget_cloud(cloud)
10941094

10951095
# remove models from most recently made, to first made
1096-
aliases = list(reversed(self._models.keys()))
1097-
for model in aliases:
1096+
for model in list(reversed(self._models)):
10981097
await self.forget_model(model)
10991098

11001099
await self._controller.disconnect()

0 commit comments

Comments
 (0)