File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import os
2+
3+ import pytest
4+
5+ from usethis ._integrations .ci .github .errors import GitHubTagError
16from usethis ._integrations .ci .github .tags import get_github_latest_tag
27from usethis ._integrations .pre_commit .schema import UriRepo
38from usethis ._tool .impl .codespell import CodespellTool
@@ -8,6 +13,13 @@ def test_latest_version(self):
813 (config ,) = CodespellTool ().get_pre_commit_config ().repo_configs
914 repo = config .repo
1015 assert isinstance (repo , UriRepo )
11- assert repo .rev == get_github_latest_tag (
12- owner = "codespell-project" , repo = "codespell"
13- )
16+ try :
17+ assert repo .rev == get_github_latest_tag (
18+ owner = "codespell-project" , repo = "codespell"
19+ )
20+ except GitHubTagError as err :
21+ if os .getenv ("CI" ):
22+ pytest .skip (
23+ "Failed to fetch GitHub tags (connection issues); skipping test"
24+ )
25+ raise err
Original file line number Diff line number Diff line change 1+ import os
12from pathlib import Path
23
34import pytest
45
56from usethis ._config_file import files_manager
7+ from usethis ._integrations .ci .github .errors import GitHubTagError
68from usethis ._integrations .ci .github .tags import get_github_latest_tag
79from usethis ._integrations .pre_commit .schema import UriRepo
810from usethis ._test import change_cwd
@@ -30,6 +32,13 @@ def test_latest_version(self):
3032 (config ,) = PyprojectFmtTool ().get_pre_commit_config ().repo_configs
3133 repo = config .repo
3234 assert isinstance (repo , UriRepo )
33- assert repo .rev == get_github_latest_tag (
34- owner = "tox-dev" , repo = "pyproject-fmt"
35- )
35+ try :
36+ assert repo .rev == get_github_latest_tag (
37+ owner = "tox-dev" , repo = "pyproject-fmt"
38+ )
39+ except GitHubTagError as err :
40+ if os .getenv ("CI" ):
41+ pytest .skip (
42+ "Failed to fetch GitHub tags (connection issues); skipping test"
43+ )
44+ raise err
You can’t perform that action at this time.
0 commit comments