设置断点测试时,我单击“跳过”,代码不输入下一个断点?我不知道为什么?
这是第一个入口断点,现在type
的形式是int:
断点一:
create_client(): form = ClientForm(data=data)
然后跨步,进入断点两个,现在形式type
来自int转换枚举:
class ClientForm(): client = ClientTypeEnum(value.data)
flask1.0
pycharm2018
client.py:
from app.validators.forms import ClientForm
create_client():
data = request.json
form = ClientForm(data=data)
if form.validate():
promise = {
ClientTypeEnum.USER_EMAIL: _register_by_user_email
}
promise[form.type.data]()
return 'success'
forms.py:
from app.libs.enums import ClientTypeEnum
class ClientForm(Form):
...
type = IntegerField(validators=[DataRequired()])
def validator_type(self, value):
client = ClientTypeEnum(value.data)
self.type.data = client
enums.py:
class ClientTypeEnum(Enum):
USER_EMAIL = 100
我希望断点输入form=ClientForm(data=data)
越过断点输入class ClientForm
。