Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: correct ModuleNotFoundError() arguments#2033

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 1 commit intomainfromjlvillal/module_not_found_error
May 30, 2022
Merged
Show file tree
Hide file tree
Changes fromall 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
2 changes: 1 addition & 1 deletiongitlab/cli.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -301,7 +301,7 @@ def main() -> None:
sys.exit(e)
# We only support v4 API at this time
if config.api_version not in ("4",): # dead code # pragma: no cover
raise ModuleNotFoundError(name=f"gitlab.v{config.api_version}.cli")
raise ModuleNotFoundError(f"gitlab.v{config.api_version}.cli")

# Now we build the entire set of subcommands and do the complete parsing
parser = _get_parser()
Expand Down
4 changes: 2 additions & 2 deletionsgitlab/client.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -116,7 +116,7 @@ def __init__(

# We only support v4 API at this time
if self._api_version not in ("4",):
raise ModuleNotFoundError(name=f"gitlab.v{self._api_version}.objects")
raise ModuleNotFoundError(f"gitlab.v{self._api_version}.objects")
# NOTE: We must delay import of gitlab.v4.objects until now or
# otherwise it will cause circular import errors
import gitlab.v4.objects
Expand DownExpand Up@@ -209,7 +209,7 @@ def __setstate__(self, state: Dict[str, Any]) -> None:
# We only support v4 API at this time
if self._api_version not in ("4",):
raise ModuleNotFoundError(
name=f"gitlab.v{self._api_version}.objects"
f"gitlab.v{self._api_version}.objects"
) # pragma: no cover, dead code currently
# NOTE: We must delay import of gitlab.v4.objects until now or
# otherwise it will cause circular import errors
Expand Down
2 changes: 1 addition & 1 deletiontests/unit/test_gitlab.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -91,7 +91,7 @@ def test_gitlab_init_with_valid_api_version():


def test_gitlab_init_with_invalid_api_version():
with pytest.raises(ModuleNotFoundError):
with pytest.raises(ModuleNotFoundError, match="gitlab.v1.objects"):
gitlab.Gitlab(api_version="1")


Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp