@@ -204,31 +204,30 @@ class MyRequiredTest(HelloTest):
204204
205205 def __init__ (self , * args , ** kwargs ):
206206 alias = kwargs .pop ('alias' , None )
207- if alias and 'field' in kwargs :
207+ if alias is not None and 'field' in kwargs :
208208 raise ValueError (f"'field' cannot be set for an alias variable" )
209209
210- if alias and 'value' in kwargs :
210+ if alias is not None and 'value' in kwargs :
211211 raise ValueError ('alias variables do not accept default values' )
212212
213- if alias and not isinstance (alias , TestVar ):
213+ if alias is not None and not isinstance (alias , TestVar ):
214214 raise TypeError (f"'alias' must refer to a variable; "
215215 f"found { type (alias ).__name__ !r} " )
216216
217217 field_type = kwargs .pop ('field' , fields .TypedField )
218- if alias :
218+ if alias is not None :
219219 self ._p_default_value = alias ._default_value
220220 else :
221221 self ._p_default_value = kwargs .pop ('value' , Undefined )
222222
223223 self ._loggable = kwargs .pop ('loggable' , False )
224-
225224 if not issubclass (field_type , fields .Field ):
226225 raise TypeError (
227226 f'field { field_type !r} is not derived from '
228227 f'{ fields .Field .__qualname__ } '
229228 )
230229
231- if alias :
230+ if alias is not None :
232231 self ._p_field = alias ._field
233232 else :
234233 self ._p_field = field_type (* args , ** kwargs )
0 commit comments