以下のコードで何故か、一つ値を返していないエラーが吐き出されます?なぜでしょうか?どう解決すればよいのでしょうか?
flask
1def preset_header(): 2 d = {'test': ["test1:test2", "Authorization"]} 3 for v in d.values(): 4 import pdb; 5 pdb.set_trace() 6 yield v[0], v[1] 7 8 9@pytest.fixture 10def req(app): 11 12 auth_header, auth_test = preset_header() 13 ... 14 ... 15 ... 16 17 with app.test_request_context(path, method="POST", headers=headers, data=payload) as req: 18 yield req 19
error
> auth_header, auth_test = preset_header() E ValueError: not enough values to unpack (expected 2, got 1) test_decorators.py:252: ValueError
pdb
1-> yield v[0], v[1] 2(Pdb) p v 3["test1:test2", "Authorization"] 4(Pdb) p v[0] 5"test1:test2" 6(Pdb) p v [1] 7'Authorization'
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/09/06 04:38
2018/09/06 04:47
2018/09/06 04:59
2018/09/06 05:08
2018/09/06 05:45