Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1bc56d1

Browse files
nejchJohnVillalovos
authored andcommitted
test(unit): consistently use inline fixtures
1 parent847004b commit1bc56d1

File tree

3 files changed

+31
-88
lines changed

3 files changed

+31
-88
lines changed

‎tests/unit/conftest.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
importgitlab
44

55

6-
@pytest.fixture(scope="session")
7-
deffixture_dir(test_dir):
8-
returntest_dir/"unit"/"fixtures"
9-
10-
116
@pytest.fixture
127
defgl():
138
returngitlab.Gitlab(

‎tests/unit/fixtures/todo.json‎

Lines changed: 0 additions & 75 deletions
This file was deleted.

‎tests/unit/objects/test_todos.py‎

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,43 @@
11
"""
22
GitLab API: https://docs.gitlab.com/ce/api/todos.html
33
"""
4-
5-
importjson
6-
74
importpytest
85
importresponses
96

107
fromgitlab.v4.objectsimportTodo
118

129

13-
@pytest.fixture()
14-
defjson_content(fixture_dir):
15-
withopen(fixture_dir/"todo.json","r",encoding="utf-8")asf:
16-
todo_content=f.read()
17-
returnjson.loads(todo_content)
10+
@pytest.fixture
11+
defjson_content():
12+
return [
13+
{
14+
"id":102,
15+
"project": {
16+
"id":2,
17+
"name":"Gitlab Ce",
18+
"name_with_namespace":"Gitlab Org / Gitlab Ce",
19+
"path":"gitlab-ce",
20+
"path_with_namespace":"gitlab-org/gitlab-ce",
21+
},
22+
"author": {
23+
"name":"Administrator",
24+
"username":"root",
25+
"id":1,
26+
},
27+
"action_name":"marked",
28+
"target_type":"MergeRequest",
29+
"target": {
30+
"id":34,
31+
"iid":7,
32+
"project_id":2,
33+
"assignee": {
34+
"name":"Administrator",
35+
"username":"root",
36+
"id":1,
37+
},
38+
},
39+
}
40+
]
1841

1942

2043
@pytest.fixture

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp