Skip to content

Commit 5901903

Browse files
committed
1 parent 425eed0 commit 5901903

File tree

4 files changed

+48
-48
lines changed

4 files changed

+48
-48
lines changed

tests/sync/test_git.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -723,9 +723,9 @@ def test_set_remote(git_repo: GitSync, repo_name: str, new_repo_url: str) -> Non
723723
remote = git_repo.remote(name="myrepo")
724724
assert remote is not None
725725
if remote is not None:
726-
assert (
727-
new_repo_url in remote.fetch_url
728-
), "Running remove_set should overwrite previous remote"
726+
assert new_repo_url in remote.fetch_url, (
727+
"Running remove_set should overwrite previous remote"
728+
)
729729

730730

731731
def test_get_git_version(git_repo: GitSync) -> None:
@@ -741,9 +741,9 @@ def test_get_current_remote_name(git_repo: GitSync) -> None:
741741

742742
new_branch = "another-branch-with-no-upstream"
743743
git_repo.run(["checkout", "-B", new_branch])
744-
assert (
745-
git_repo.get_current_remote_name() == new_branch
746-
), "branch w/o upstream should return branch only"
744+
assert git_repo.get_current_remote_name() == new_branch, (
745+
"branch w/o upstream should return branch only"
746+
)
747747

748748
new_remote_name = "new_remote_name"
749749
git_repo.set_remote(
@@ -753,25 +753,25 @@ def test_get_current_remote_name(git_repo: GitSync) -> None:
753753
)
754754
git_repo.run(["fetch", new_remote_name])
755755
git_repo.run(["branch", "--set-upstream-to", f"{new_remote_name}/{new_branch}"])
756-
assert (
757-
git_repo.get_current_remote_name() == new_remote_name
758-
), "Should reflect new upstream branch (different remote)"
756+
assert git_repo.get_current_remote_name() == new_remote_name, (
757+
"Should reflect new upstream branch (different remote)"
758+
)
759759

760760
upstream = "{}/{}".format(new_remote_name, "master")
761761

762762
git_repo.run(["branch", "--set-upstream-to", upstream])
763-
assert (
764-
git_repo.get_current_remote_name() == upstream
765-
), "Should reflect upstream branch (different remote+branch)"
763+
assert git_repo.get_current_remote_name() == upstream, (
764+
"Should reflect upstream branch (different remote+branch)"
765+
)
766766

767767
git_repo.run(["checkout", "master"])
768768

769769
# Different remote, different branch
770770
remote = f"{new_remote_name}/{new_branch}"
771771
git_repo.run(["branch", "--set-upstream-to", remote])
772-
assert (
773-
git_repo.get_current_remote_name() == remote
774-
), "Should reflect new upstream branch (different branch)"
772+
assert git_repo.get_current_remote_name() == remote, (
773+
"Should reflect new upstream branch (different branch)"
774+
)
775775

776776

777777
def test_GitRemote_from_stdout() -> None:

tests/url/test_git.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,17 @@ class GitURLWithPip(GitBaseURL):
177177
git_url.url = git_url.url.format(local_repo=git_repo.path)
178178

179179
if is_generic:
180-
assert (
181-
GitBaseURL.is_valid(url) == is_valid
182-
), f"{url} compatibility should be {is_valid}"
180+
assert GitBaseURL.is_valid(url) == is_valid, (
181+
f"{url} compatibility should be {is_valid}"
182+
)
183183
else:
184-
assert (
185-
GitBaseURL.is_valid(url) != is_valid
186-
), f"{url} compatibility should work with core, expects {not is_valid}"
184+
assert GitBaseURL.is_valid(url) != is_valid, (
185+
f"{url} compatibility should work with core, expects {not is_valid}"
186+
)
187187

188-
assert (
189-
GitURLWithPip.is_valid(url) == is_valid
190-
), f"{url} compatibility should be {is_valid}"
188+
assert GitURLWithPip.is_valid(url) == is_valid, (
189+
f"{url} compatibility should be {is_valid}"
190+
)
191191
assert GitURLWithPip(url) == git_url
192192

193193

@@ -258,16 +258,16 @@ class GitURLWithAWSCodeCommit(GitBaseURL):
258258
git_url.url = git_url.url.format(local_repo=git_repo.path)
259259

260260
if is_generic:
261-
assert (
262-
GitBaseURL.is_valid(url) == is_valid
263-
), f"{url} compatibility should be {is_valid}"
261+
assert GitBaseURL.is_valid(url) == is_valid, (
262+
f"{url} compatibility should be {is_valid}"
263+
)
264264
else:
265-
assert (
266-
GitBaseURL.is_valid(url) != is_valid
267-
), f"{url} compatibility should work with core, expects {not is_valid}"
268-
assert (
269-
GitURLWithAWSCodeCommit.is_valid(url) == is_valid
270-
), f"{url} compatibility should be {is_valid}"
265+
assert GitBaseURL.is_valid(url) != is_valid, (
266+
f"{url} compatibility should work with core, expects {not is_valid}"
267+
)
268+
assert GitURLWithAWSCodeCommit.is_valid(url) == is_valid, (
269+
f"{url} compatibility should be {is_valid}"
270+
)
271271
assert GitURLWithAWSCodeCommit(url) == git_url
272272

273273

tests/url/test_hg.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ class HgURLWithPip(HgURL):
140140
hg_url = HgURLWithPip(**hg_url_kwargs)
141141
hg_url.url = hg_url.url.format(local_repo=hg_repo.path)
142142

143-
assert (
144-
HgBaseURL.is_valid(url) != is_valid
145-
), f"{url} compatibility should work with core, expects {not is_valid}"
146-
assert (
147-
HgURLWithPip.is_valid(url) == is_valid
148-
), f"{url} compatibility should be {is_valid}"
143+
assert HgBaseURL.is_valid(url) != is_valid, (
144+
f"{url} compatibility should work with core, expects {not is_valid}"
145+
)
146+
assert HgURLWithPip.is_valid(url) == is_valid, (
147+
f"{url} compatibility should be {is_valid}"
148+
)
149149
assert HgURLWithPip(url) == hg_url
150150

151151

tests/url/test_svn.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ class SvnURLWithPip(SvnURL):
147147
svn_url = SvnURLWithPip(**svn_url_kwargs)
148148
svn_url.url = svn_url.url.format(local_repo=svn_repo.path)
149149

150-
assert (
151-
SvnBaseURL.is_valid(url) != is_valid
152-
), f"{url} compatibility should work with core, expects {not is_valid}"
153-
assert (
154-
SvnURL.is_valid(url) == is_valid
155-
), f"{url} compatibility should work with core, expects {not is_valid}"
156-
assert (
157-
SvnURLWithPip.is_valid(url) == is_valid
158-
), f"{url} compatibility should be {is_valid}"
150+
assert SvnBaseURL.is_valid(url) != is_valid, (
151+
f"{url} compatibility should work with core, expects {not is_valid}"
152+
)
153+
assert SvnURL.is_valid(url) == is_valid, (
154+
f"{url} compatibility should work with core, expects {not is_valid}"
155+
)
156+
assert SvnURLWithPip.is_valid(url) == is_valid, (
157+
f"{url} compatibility should be {is_valid}"
158+
)
159159
assert SvnURLWithPip(url) == svn_url
160160

161161

0 commit comments

Comments
 (0)