kopia lustrzana https://github.com/Yakifo/amqtt
fix flake8 error
rodzic
5181289d2b
commit
1bc2e06be2
|
@ -29,11 +29,13 @@ def _verify_module(module, plugin_module_name):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
obj = clazz(_TestContext())
|
obj = clazz(_TestContext())
|
||||||
with pytest.raises(AttributeError, match=f"'{name}' object has no attribute '{_INVALID_METHOD}'"):
|
with pytest.raises(
|
||||||
|
AttributeError,
|
||||||
|
match=f"'{name}' object has no attribute '{_INVALID_METHOD}'",
|
||||||
|
):
|
||||||
getattr(obj, _INVALID_METHOD)
|
getattr(obj, _INVALID_METHOD)
|
||||||
assert hasattr(obj, _INVALID_METHOD) is False
|
assert hasattr(obj, _INVALID_METHOD) is False
|
||||||
|
|
||||||
|
|
||||||
for name, obj in inspect.getmembers(module, inspect.ismodule):
|
for name, obj in inspect.getmembers(module, inspect.ismodule):
|
||||||
_verify_module(obj, plugin_module_name)
|
_verify_module(obj, plugin_module_name)
|
||||||
|
|
||||||
|
@ -45,7 +47,7 @@ def test_plugins_correct_has_attr():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
name = file.replace("/", ".")
|
name = file.replace("/", ".")
|
||||||
name = name[name.find(module.__name__) : -3].removesuffix(".__init__")
|
name = name[name.find(module.__name__): -3].removesuffix(".__init__")
|
||||||
|
|
||||||
__import__(name)
|
__import__(name)
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue