Formating.

This commit is contained in:
Romain Dorgueil
2017-05-22 10:35:54 +02:00
parent a45a6830c7
commit 52b06834e2
3 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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).

View File

@ -15,6 +15,7 @@ class MethodBasedConfigurable(Configurable):
def test_one_wrapper_only():
with pytest.raises(ConfigurationError):
class TwoMethods(Configurable):
h1 = Method()
h2 = Method()