Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test test_delete_branch_on_missing_branch_fails #2088

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/test_hf_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading