Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-doggart authored Jul 24, 2024
2 parents 694427b + 2ca39bd commit ed53d25
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
8 changes: 5 additions & 3 deletions flask_restx/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
]
Expand Down
8 changes: 5 additions & 3 deletions flask_restx/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)

Expand Down
8 changes: 5 additions & 3 deletions flask_restx/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions flask_restx/schemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.. versionadded:: 0.12.1
"""

import io
import json

Expand Down
8 changes: 5 additions & 3 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"[email protected]",
"[email protected]",
Expand Down

0 comments on commit ed53d25

Please sign in to comment.