Formating.
This commit is contained in:
@ -56,7 +56,7 @@ class Configurable(metaclass=ConfigurableMeta):
|
||||
|
||||
def __new__(cls, *args, **kwargs):
|
||||
if cls.__wrappable__ and len(args) == 1 and hasattr(args[0], '__call__'):
|
||||
return type(args[0].__name__, (cls,), {cls.__wrappable__: args[0]})
|
||||
return type(args[0].__name__, (cls, ), {cls.__wrappable__: args[0]})
|
||||
|
||||
return super(Configurable, cls).__new__(cls)
|
||||
|
||||
|
||||
@ -74,7 +74,6 @@ class Option:
|
||||
return self.default() if callable(self.default) else self.default
|
||||
|
||||
|
||||
|
||||
class Method(Option):
|
||||
"""
|
||||
A Method is a special callable-valued option, that can be used in three different ways (but for same purpose).
|
||||
|
||||
@ -15,6 +15,7 @@ class MethodBasedConfigurable(Configurable):
|
||||
|
||||
def test_one_wrapper_only():
|
||||
with pytest.raises(ConfigurationError):
|
||||
|
||||
class TwoMethods(Configurable):
|
||||
h1 = Method()
|
||||
h2 = Method()
|
||||
|
||||
Reference in New Issue
Block a user