浏览代码

tests: fix duplicated entries in TestVMsCollection

Deduplicate entries when iterating over TestVMsCollection values. Some
tests add given VM multiple times, to have it available under different
kind of keys (name, uuid etc) - similar to the real VMsCollection.
Marek Marczykowski-Górecki 3 年之前
父节点
当前提交
ed5b908371
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      qubes/tests/vm/__init__.py

+ 1 - 1
qubes/tests/vm/__init__.py

@@ -56,7 +56,7 @@ class TestVMsCollection(dict):
         self.clear()
 
     def __iter__(self):
-        return iter(self.values())
+        return iter(set(self.values()))
 
 class TestVolume(object):
     def __init__(self, pool):