parent
de4c2dc98d
commit
f0a277008a
|
@ -90,9 +90,7 @@ class Registry:
|
|||
l = []
|
||||
if plugins is None:
|
||||
plugins = self._plugins
|
||||
if extra:
|
||||
plugins += list(extra)
|
||||
for plugin in plugins:
|
||||
for plugin in list(plugins) + list(extra):
|
||||
try:
|
||||
l.append(getattr(plugin, attrname))
|
||||
except AttributeError:
|
||||
|
|
|
@ -135,6 +135,12 @@ class TestRegistry:
|
|||
l = list(plugins.listattr('x', reverse=True))
|
||||
assert l == [43, 42, 41]
|
||||
|
||||
class api4:
|
||||
x = 44
|
||||
l = list(plugins.listattr('x', extra=(api4,)))
|
||||
assert l == range(41, 45)
|
||||
assert len(list(plugins)) == 3 # otherwise extra added
|
||||
|
||||
def test_api_and_defaults():
|
||||
assert isinstance(py._com.comregistry, Registry)
|
||||
|
||||
|
|
Loading…
Reference in New Issue