From dd34b5dd75d98125553a853fd2ee1338ed63047c Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Wed, 6 Mar 2024 14:24:01 +0100 Subject: [PATCH] Fix test test_delete_branch_on_missing_branch_fails --- tests/test_hf_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_hf_api.py b/tests/test_hf_api.py index 99cc1fea9f..a458ec9da7 100644 --- a/tests/test_hf_api.py +++ b/tests/test_hf_api.py @@ -1545,12 +1545,12 @@ def test_delete_branch_on_protected_branch_fails(self, repo_url: RepoUrl) -> Non @use_tmp_repo() def test_delete_branch_on_missing_branch_fails(self, repo_url: RepoUrl) -> None: """Test `delete_branch` fails on missing branch.""" - with self.assertRaisesRegex(HfHubHTTPError, "Reference does not exist"): + with self.assertRaisesRegex(HfHubHTTPError, "Invalid rev id"): self._api.delete_branch(repo_url.repo_id, branch="cool-branch") # Using a tag instead of branch -> fails self._api.create_tag(repo_url.repo_id, tag="cool-tag") - with self.assertRaisesRegex(HfHubHTTPError, "Reference does not exist"): + with self.assertRaisesRegex(HfHubHTTPError, "Invalid rev id"): self._api.delete_branch(repo_url.repo_id, branch="cool-tag") @use_tmp_repo()