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

Commitcfed622

Browse files
nejchJohnVillalovos
authored andcommitted
style: use f-strings where applicable
1 parentdc32d54 commitcfed622

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

‎docs/ext/docstrings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ def classref(value, short=True):
1111
returnvalue
1212

1313
ifnotinspect.isclass(value):
14-
return":class:%s"%value
14+
returnf":class:{value}"
1515
tilde="~"ifshortelse""
16-
return":class:`%sgitlab.objects.%s`"% (tilde,value.__name__)
16+
returnf":class:`{tilde}gitlab.objects.{value.__name__}`"
1717

1818

1919
defsetup(app):

‎tests/functional/api/test_projects.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,11 @@ def test_project_file_uploads(project):
106106
file_contents="testing contents"
107107

108108
uploaded_file=project.upload(filename,file_contents)
109-
assertuploaded_file["alt"]==filename
110-
assertuploaded_file["url"].startswith("/uploads/")
111-
assertuploaded_file["url"].endswith(f"/{filename}")
112-
assertuploaded_file["markdown"]=="[{}]({})".format(
113-
uploaded_file["alt"],uploaded_file["url"]
114-
)
109+
alt,url=uploaded_file["alt"],uploaded_file["url"]
110+
assertalt==filename
111+
asserturl.startswith("/uploads/")
112+
asserturl.endswith(f"/{filename}")
113+
assertuploaded_file["markdown"]==f"[{alt}]({url})"
115114

116115

117116
deftest_project_forks(gl,project,user):

‎tests/unit/objects/test_packages.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,7 @@
107107
package_version="v1.0.0"
108108
file_name="hello.tar.gz"
109109
file_content="package content"
110-
package_url="http://localhost/api/v4/projects/1/packages/generic/{}/{}/{}".format(
111-
package_name,
112-
package_version,
113-
file_name,
114-
)
110+
package_url=f"http://localhost/api/v4/projects/1/packages/generic/{package_name}/{package_version}/{file_name}"
115111

116112

117113
@pytest.fixture

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp