Skip to content

Commit 2ca39bd

Browse files
Fix for "EmailTest.test_invalid_values_check" unit test (#603)
* Fixed test_invalid_values_check unit test * Fixed lint error
1 parent b38a7d9 commit 2ca39bd

File tree

6 files changed

+22
-13
lines changed

6 files changed

+22
-13
lines changed

flask_restx/fields.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,11 @@ def is_attr(val):
333333
return [
334334
self.container.output(
335335
idx,
336-
val
337-
if (isinstance(val, dict) or is_attr(val)) and not is_nested
338-
else value,
336+
(
337+
val
338+
if (isinstance(val, dict) or is_attr(val)) and not is_nested
339+
else value
340+
),
339341
)
340342
for idx, val in enumerate(value)
341343
]

flask_restx/marshalling.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,11 @@ def __format_field(key, val):
171171
return (key, value)
172172

173173
items = (
174-
(k, marshal(data, v, skip_none=skip_none, ordered=ordered))
175-
if isinstance(v, dict)
176-
else __format_field(k, v)
174+
(
175+
(k, marshal(data, v, skip_none=skip_none, ordered=ordered))
176+
if isinstance(v, dict)
177+
else __format_field(k, v)
178+
)
177179
for k, v in fields.items()
178180
)
179181

flask_restx/namespace.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,11 @@ def marshal_with(
253253
def wrapper(func):
254254
doc = {
255255
"responses": {
256-
str(code): (description, [fields], kwargs)
257-
if as_list
258-
else (description, fields, kwargs)
256+
str(code): (
257+
(description, [fields], kwargs)
258+
if as_list
259+
else (description, fields, kwargs)
260+
)
259261
},
260262
"__mask__": kwargs.get(
261263
"mask", True

flask_restx/schemas/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
.. versionadded:: 0.12.1
66
"""
7+
78
import io
89
import json
910

tasks.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,11 @@ def benchmark(
125125
"--benchmark-max-time={0}".format(max_time),
126126
"--benchmark-autosave" if save else None,
127127
"--benchmark-compare" if compare else None,
128-
"--benchmark-histogram=histograms/{0:%Y%m%d-%H%M%S}".format(ts)
129-
if histogram
130-
else None,
128+
(
129+
"--benchmark-histogram=histograms/{0:%Y%m%d-%H%M%S}".format(ts)
130+
if histogram
131+
else None
132+
),
131133
"--benchmark-cprofile=tottime" if profile else None,
132134
)
133135
cmd = "pytest tests/benchmarks {0}".format(kwargs)

tests/test_inputs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ def test_valid_value_check(self, value):
653653
@pytest.mark.parametrize(
654654
"value",
655655
[
656-
"coucou@not-found.fr",
656+
"coucou@not-found.test",
657657
"me@localhost",
658658
659659

0 commit comments

Comments
 (0)