-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
整理: e2e single API テスト vol 4 #1149
整理: e2e single API テスト vol 4 #1149
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
from fastapi.testclient import TestClient | ||
|
||
|
||
@pytest.mark.skip(reason="プリセット追加が他のテストに干渉するから") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なるほどです!
いろんな迂回策がありそうですが、引数にしてる(=fixture)のclientのtearDownとして登録されてるプリセットの削除とかを実行すると良い気がしました!
client fixtureを定義してるとこでclientをreturnではなくyieldで返して、その後にクリーンナップ処理を書けば良いはず…?
https://docs.pytest.org/en/6.2.x/fixture.html#teardown-cleanup-aka-fixture-finalization
内容
次のAPIに対し e2e テストを追加した。
GET /presets
200
POST /add_preset
200
POST /update_preset
200
422
POST /delete_preset
200
422
関連 Issue
part of #1065