File tree 4 files changed +9
-4
lines changed
4 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,8 @@ def _try_coerce(
141
141
type (values (self .enum )[0 ])
142
142
):
143
143
raise ValueError (
144
- f"'{ value } ' is not a valid { self .enum .__name__ } "
144
+ f"'{ value } ' is not a valid "
145
+ f"{ self .enum .__name__ } "
145
146
f"required by field { self .name } ."
146
147
) from err
147
148
return value
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ class EnumChoiceField(TypedChoiceField):
67
67
enum_ : Optional [Type [Enum ]] = None
68
68
strict_ : bool = True
69
69
empty_value : Any = ''
70
- empty_values : List [Any ]
70
+ empty_values : List [Any ] = TypedChoiceField . empty_values
71
71
choices : Iterable [Tuple [Any , Any ]]
72
72
73
73
@property
@@ -114,7 +114,7 @@ def __init__(
114
114
* ,
115
115
empty_value : Any = _Unspecified ,
116
116
strict : bool = strict_ ,
117
- empty_values : List [Any ] = TypedChoiceField . empty_values ,
117
+ empty_values : List [Any ] = empty_values . copy () ,
118
118
choices : Iterable [Tuple [Any , str ]] = (),
119
119
** kwargs
120
120
):
Original file line number Diff line number Diff line change @@ -55,7 +55,10 @@ isort = "^5.6.4"
55
55
doc8 = " ^0.11.0"
56
56
darglint = " ^1.5.7"
57
57
pytest-cov = " ^4.0.0"
58
- pylint = " ^2.6.0"
58
+ pylint = [
59
+ { version = " <3.0" , markers = " python_version <= '3.7'" },
60
+ { version = " ^3.0" , markers = " python_version > '3.7'" },
61
+ ]
59
62
sphinx-argparse = " ^0.3.0"
60
63
deepdiff = " >=5.2.3,<7.0.0"
61
64
safety = " ^2.0.0"
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ valid-metaclass-classmethod-first-arg = mcs
11
11
12
12
[pylint.DESIGN]
13
13
max-branches =15
14
+ max-args =6
14
15
15
16
[pylint.MASTER]
16
17
ignore =tests
You can’t perform that action at this time.
0 commit comments