diff --git a/tools/contributor-metrics/tests/test_fetch.py b/tools/contributor-metrics/tests/test_fetch.py index 0d2199c68..fda77e03f 100644 --- a/tools/contributor-metrics/tests/test_fetch.py +++ b/tools/contributor-metrics/tests/test_fetch.py @@ -363,7 +363,7 @@ def convo(dates): def test_rate_limit_is_retried_with_backoff(fake_gh, monkeypatch): - import contributor_metrics.fetch as f + from contributor_metrics import fetch as f sleeps = [] monkeypatch.setattr(f.time, "sleep", lambda s: sleeps.append(s)) @@ -383,7 +383,7 @@ def flaky(cmd, *a, **k): def test_other_gh_errors_are_not_retried(fake_gh, monkeypatch): - import contributor_metrics.fetch as f + from contributor_metrics import fetch as f monkeypatch.setattr(f.time, "sleep", lambda s: (_ for _ in ()).throw(AssertionError("should not sleep"))) monkeypatch.setattr( diff --git a/tools/jira/tests/test_rest.py b/tools/jira/tests/test_rest.py index 67ee7dfb7..79f87db7e 100644 --- a/tools/jira/tests/test_rest.py +++ b/tools/jira/tests/test_rest.py @@ -15,7 +15,7 @@ import pytest -import jira_bridge.rest as rest_mod +from jira_bridge import rest as rest_mod from jira_bridge.rest import JiraRest, JiraRestConfigError, JiraRestError BASE = "https://issues.example.org/jira" diff --git a/tools/reproducible-archive/tests/test_reproducible_archive.py b/tools/reproducible-archive/tests/test_reproducible_archive.py index fbd73ec4d..a7f7f8bd5 100644 --- a/tools/reproducible-archive/tests/test_reproducible_archive.py +++ b/tools/reproducible-archive/tests/test_reproducible_archive.py @@ -194,9 +194,10 @@ def test_symlink_mode_is_platform_independent(fmt: str) -> None: macos = [*base, ra.Entry("p/link", "symlink", 0o755, linkname="target")] linux = [*base, ra.Entry("p/link", "symlink", 0o777, linkname="target")] write = ra.write_zip if fmt == "zip" else ra.write_tar_gz - assert write(macos, EPOCH) == write(linux, EPOCH) + macos_archive, linux_archive = write(macos, EPOCH), write(linux, EPOCH) + assert macos_archive == linux_archive assert ra.swhid_dir_of_entries(macos, "p") == ra.swhid_dir_of_entries(linux, "p") - packed = ra.read_zip_entries(write(macos, EPOCH)) if fmt == "zip" else ra.read_tar_entries(write(macos, EPOCH)) + packed = ra.read_zip_entries(macos_archive) if fmt == "zip" else ra.read_tar_entries(macos_archive) assert [e.mode for e in packed if e.kind == "symlink"] == [0o777] diff --git a/tools/vetted-ops/src/vetted_ops/ops.py b/tools/vetted-ops/src/vetted_ops/ops.py index 1a13978e2..e6539f9d5 100644 --- a/tools/vetted-ops/src/vetted_ops/ops.py +++ b/tools/vetted-ops/src/vetted_ops/ops.py @@ -1870,9 +1870,11 @@ def build(cfg: dict[str, str], login: str) -> list[str]: # paths drops that flag, so a caller cannot tell a complete listing # from a partial one and reads the gap as "those paths do not # exist". Fail loudly instead of answering with half a tree. - 'if .truncated then error("repo-tree: the GitHub API truncated ' - "this tree; the listing is incomplete. Walk the tree level by " - 'level instead of relying on recursive=1.") else .tree[].path end', + ( + 'if .truncated then error("repo-tree: the GitHub API truncated ' + "this tree; the listing is incomplete. Walk the tree level by " + 'level instead of relying on recursive=1.") else .tree[].path end' + ), ], ) )