Skip to content

Commit

Permalink
replace double quotes with single quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
antoni-szych-rtbhouse committed Jan 31, 2024
1 parent 10e984c commit 9c3e0cd
Show file tree
Hide file tree
Showing 5 changed files with 231 additions and 231 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
author='Alec Thomas',
author_email='alec@swapoff.org',
python_requires=">=3.8",
python_requires='>=3.8',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
Expand Down
22 changes: 11 additions & 11 deletions voluptuous/schema_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def raises(
if regex is not None:
assert re.search(regex, str(e)), '%r does not match %r' % (str(e), regex)
else:
raise AssertionError(f"Did not raise exception {exc.__name__}")
raise AssertionError(f'Did not raise exception {exc.__name__}')


def Extra(_) -> None:
Expand Down Expand Up @@ -268,7 +268,7 @@ def __str__(self):
return str(self.schema)

def __repr__(self):
return "<Schema(%s, extra=%s, required=%s) object at 0x%x>" % (
return '<Schema(%s, extra=%s, required=%s) object at 0x%x>' % (
self.schema,
self._extra_to_name.get(self.extra, '??'),
self.required,
Expand All @@ -290,7 +290,7 @@ def _compile(self, schema):
return lambda _, v: v
if schema is Self:
return lambda p, v: self._compiled(p, v)
elif hasattr(schema, "__voluptuous_compile__"):
elif hasattr(schema, '__voluptuous_compile__'):
return schema.__voluptuous_compile__(self)
if isinstance(schema, Object):
return self._compile_object(schema)
Expand Down Expand Up @@ -983,7 +983,7 @@ def __init__(
) -> None:
if cls and not issubclass(cls, er.Invalid):
raise er.SchemaError(
"Msg can only use subclases of Invalid as custom class"
'Msg can only use subclases of Invalid as custom class'
)
self._schema = schema
self.schema = Schema(schema)
Expand Down Expand Up @@ -1127,7 +1127,7 @@ class Exclusive(Optional):
... }
... })
>>> with raises(er.MultipleInvalid, "Please, use only one type of authentication at the same time. @ data[<auth>]"):
>>> with raises(er.MultipleInvalid, 'Please, use only one type of authentication at the same time. @ data[<auth>]'):
... schema({'classic': {'email': 'foo@example.com', 'password': 'bar'},
... 'social': {'social_network': 'barfoo', 'token': 'tEMp'}})
"""
Expand Down Expand Up @@ -1168,16 +1168,16 @@ class Inclusive(Optional):
For example, API can return 'height' and 'width' together, but not separately.
>>> msg = "Height and width must exist together"
>>> msg = 'Height and width must exist together'
>>> schema = Schema({
... Inclusive('height', 'size', msg=msg): int,
... Inclusive('width', 'size', msg=msg): int
... })
>>> with raises(er.MultipleInvalid, msg + " @ data[<size>]"):
>>> with raises(er.MultipleInvalid, msg + ' @ data[<size>]'):
... schema({'height': 100})
>>> with raises(er.MultipleInvalid, msg + " @ data[<size>]"):
>>> with raises(er.MultipleInvalid, msg + ' @ data[<size>]'):
... schema({'width': 100})
>>> data = {'height': 100, 'width': 100}
Expand Down Expand Up @@ -1231,7 +1231,7 @@ class Remove(Marker):
keys will be treated as extras.
>>> schema = Schema({str: int, Remove(int): str})
>>> with raises(er.MultipleInvalid, "extra keys not allowed @ data[1]"):
>>> with raises(er.MultipleInvalid, 'extra keys not allowed @ data[1]'):
... schema({'keep': 1, 1: 1.0})
>>> schema({1: 'red', 'red': 1, 2: 'green'})
{'red': 1}
Expand All @@ -1245,7 +1245,7 @@ def __call__(self, schema: Schemable):
return self.__class__

def __repr__(self):
return "Remove(%r)" % (self.schema,)
return 'Remove(%r)' % (self.schema,)

def __hash__(self):
return object.__hash__(self)
Expand Down Expand Up @@ -1284,7 +1284,7 @@ def message(
"""
if cls and not issubclass(cls, er.Invalid):
raise er.SchemaError(
"message can only use subclases of Invalid as custom class"
'message can only use subclases of Invalid as custom class'
)

def decorator(f):
Expand Down
Loading

0 comments on commit 9c3e0cd

Please sign in to comment.