diff --git a/flask_restx/fields.py b/flask_restx/fields.py index 97957f7f..328b437c 100644 --- a/flask_restx/fields.py +++ b/flask_restx/fields.py @@ -333,9 +333,11 @@ def is_attr(val): return [ self.container.output( idx, - val - if (isinstance(val, dict) or is_attr(val)) and not is_nested - else value, + ( + val + if (isinstance(val, dict) or is_attr(val)) and not is_nested + else value + ), ) for idx, val in enumerate(value) ] diff --git a/flask_restx/marshalling.py b/flask_restx/marshalling.py index 6648f66f..df4bbecf 100644 --- a/flask_restx/marshalling.py +++ b/flask_restx/marshalling.py @@ -171,9 +171,11 @@ def __format_field(key, val): return (key, value) items = ( - (k, marshal(data, v, skip_none=skip_none, ordered=ordered)) - if isinstance(v, dict) - else __format_field(k, v) + ( + (k, marshal(data, v, skip_none=skip_none, ordered=ordered)) + if isinstance(v, dict) + else __format_field(k, v) + ) for k, v in fields.items() ) diff --git a/flask_restx/namespace.py b/flask_restx/namespace.py index 86b4b337..6d55fabe 100644 --- a/flask_restx/namespace.py +++ b/flask_restx/namespace.py @@ -253,9 +253,11 @@ def marshal_with( def wrapper(func): doc = { "responses": { - str(code): (description, [fields], kwargs) - if as_list - else (description, fields, kwargs) + str(code): ( + (description, [fields], kwargs) + if as_list + else (description, fields, kwargs) + ) }, "__mask__": kwargs.get( "mask", True diff --git a/flask_restx/schemas/__init__.py b/flask_restx/schemas/__init__.py index 27b98660..84e4db17 100644 --- a/flask_restx/schemas/__init__.py +++ b/flask_restx/schemas/__init__.py @@ -4,6 +4,7 @@ .. versionadded:: 0.12.1 """ + import io import json diff --git a/tasks.py b/tasks.py index 4f14832a..34e357d5 100644 --- a/tasks.py +++ b/tasks.py @@ -125,9 +125,11 @@ def benchmark( "--benchmark-max-time={0}".format(max_time), "--benchmark-autosave" if save else None, "--benchmark-compare" if compare else None, - "--benchmark-histogram=histograms/{0:%Y%m%d-%H%M%S}".format(ts) - if histogram - else None, + ( + "--benchmark-histogram=histograms/{0:%Y%m%d-%H%M%S}".format(ts) + if histogram + else None + ), "--benchmark-cprofile=tottime" if profile else None, ) cmd = "pytest tests/benchmarks {0}".format(kwargs) diff --git a/tests/test_inputs.py b/tests/test_inputs.py index c6539b8c..eeac7e69 100644 --- a/tests/test_inputs.py +++ b/tests/test_inputs.py @@ -653,7 +653,7 @@ def test_valid_value_check(self, value): @pytest.mark.parametrize( "value", [ - "coucou@not-found.fr", + "coucou@not-found.test", "me@localhost", "me@127.0.0.1", "me@127.1.2.3",