8000 chore: add basic type checks to functional/api tests · python-gitlab/python-gitlab@5b642a5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b642a5

Browse files
nejchJohnVillalovos
authored andcommitted
chore: add basic type checks to functional/api tests
1 parent ee143c9 commit 5b642a5

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ files = "."
88
exclude = "build/.*"
99
strict = true
1010

11-
[[tool.mypy.overrides]] # Overrides for currently untyped modules
11+
# Overrides for currently untyped modules
12+
[[tool.mypy.overrides]]
1213
module = [
1314
"docs.*",
1415
"docs.ext.*",
15-
"tests.functional.api.*",
1616
"tests.unit.*",
1717
]
1818
ignore_errors = true
1919

2020
[[tool.mypy.overrides]]
2121
module = [
2222
"tests.functional.*",
23+
"tests.functional.api.*",
2324
"tests.meta.*",
2425
"tests.smoke.*",
2526
]

tests/functional/api/test_import_export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_project_import_export(gl, project, temp_dir):
4545
raise Exception("Project export taking too much time")
4646

4747
with open(temp_dir / "gitlab-export.tgz", "wb") as f:
48-
export.download(streamed=True, action=f.write)
48+
export.download(streamed=True, action=f.write) # type: ignore[arg-type]
4949

5050
output = gl.projects.import_project(
5151
open(temp_dir / "gitlab-export.tgz", "rb"),

tests/functional/api/test_keys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import hashlib
77

88

9-
def key_fingerprint(key):
9+
def key_fingerprint(key: str) -> str:
1010
key_part = key.split()[1]
1111
decoded = base64.b64decode(key_part.encode("ascii"))
1212
digest = hashlib.sha256(decoded).digest()

tests/functional/api/test_merge_requests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def test_merge_request_reset_approvals(gitlab_url, project, wait_for_sidekiq):
177177
bot_project = bot_gitlab.projects.get(project.id, lazy=True)
178178

179179
wait_for_sidekiq(timeout=60)
180-
mr = bot_project.mergerequests.list()[0]
180+
mr = bot_project.mergerequests.list()[0] # type: ignore[index]
181181
assert mr.reset_approvals()
182182

183183

tests/functional/api/test_projects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_project_forks(gl, project, user):
142142
assert fork_project.forked_from_project["id"] == project.id
143143

144144
forks = project.forks.list()
145-
assert fork.id in map(lambda fork_project: fork_project.id, forks)
145+
assert fork.id in [fork_project.id for fork_project in forks]
146146

147147

148148
def test_project_hooks(project):

0 commit comments

Comments
 (0)
0