From 8aecf7887729b372077ba703fc1f69f96cea7115 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:47:25 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/github3/__about__.py | 1 + src/github3/__init__.py | 1 + src/github3/api.py | 1 + src/github3/apps.py | 1 + src/github3/auths.py | 1 + src/github3/checks.py | 1 + src/github3/decorators.py | 1 + src/github3/events.py | 1 + src/github3/gists/__init__.py | 1 + src/github3/gists/comment.py | 1 + src/github3/gists/file.py | 1 + src/github3/gists/gist.py | 1 + src/github3/gists/history.py | 1 + src/github3/git.py | 1 + src/github3/github.py | 1 + src/github3/issues/__init__.py | 1 + src/github3/issues/comment.py | 1 + src/github3/issues/event.py | 1 + src/github3/issues/issue.py | 1 + src/github3/issues/label.py | 1 + src/github3/licenses.py | 1 + src/github3/models.py | 1 + src/github3/notifications.py | 1 + src/github3/orgs.py | 1 + src/github3/projects.py | 1 + src/github3/pulls.py | 1 + src/github3/repos/__init__.py | 1 + src/github3/repos/branch.py | 7 ++++--- src/github3/repos/comment.py | 1 + src/github3/repos/commit.py | 1 + src/github3/repos/comparison.py | 1 + src/github3/repos/contents.py | 1 + src/github3/repos/deployment.py | 1 + src/github3/repos/hook.py | 1 + src/github3/repos/invitation.py | 1 + src/github3/repos/issue_import.py | 1 + src/github3/repos/pages.py | 1 + src/github3/repos/release.py | 1 + src/github3/repos/repo.py | 1 + src/github3/repos/stats.py | 1 + src/github3/repos/status.py | 1 + src/github3/repos/tag.py | 1 + src/github3/repos/topics.py | 1 + src/github3/repos/traffic.py | 1 + src/github3/search/code.py | 1 + src/github3/search/commit.py | 1 + src/github3/search/issue.py | 1 + src/github3/search/repository.py | 1 + src/github3/session.py | 1 + src/github3/structs.py | 1 - src/github3/users.py | 1 + src/github3/utils.py | 1 + tests/integration/test_auths.py | 2 +- tests/integration/test_checks.py | 1 + tests/integration/test_gists.py | 2 +- tests/integration/test_git.py | 3 +-- tests/integration/test_github.py | 1 + tests/integration/test_issue.py | 2 +- tests/integration/test_notifications.py | 1 + tests/integration/test_orgs.py | 3 +-- tests/integration/test_orgs_team.py | 2 +- tests/integration/test_projects.py | 1 + tests/integration/test_pulls.py | 1 + tests/integration/test_repos_branch.py | 1 + tests/integration/test_repos_commit.py | 1 + tests/integration/test_repos_deployment.py | 2 +- tests/integration/test_repos_invitation.py | 1 + tests/integration/test_repos_repo.py | 7 +------ tests/integration/test_users.py | 3 +-- tests/unit/helper.py | 4 +--- tests/unit/test_api.py | 2 +- tests/unit/test_auths.py | 3 +-- tests/unit/test_checks.py | 1 + tests/unit/test_gists.py | 2 +- tests/unit/test_git.py | 3 --- tests/unit/test_github.py | 2 -- tests/unit/test_issues_issue.py | 1 + tests/unit/test_issues_milestone.py | 2 +- tests/unit/test_notifications.py | 1 + tests/unit/test_orgs.py | 1 + tests/unit/test_projects.py | 1 + tests/unit/test_pulls.py | 1 + tests/unit/test_repos_branch.py | 2 +- tests/unit/test_repos_branch_protection.py | 1 + tests/unit/test_repos_commit.py | 3 +-- tests/unit/test_repos_deployment.py | 2 +- tests/unit/test_repos_invitation.py | 1 + tests/unit/test_repos_release.py | 1 - tests/unit/test_repos_repo.py | 13 +------------ tests/unit/test_repos_status.py | 1 - tests/unit/test_subscription.py | 1 + tests/unit/test_users.py | 9 --------- 92 files changed, 89 insertions(+), 61 deletions(-) diff --git a/src/github3/__about__.py b/src/github3/__about__.py index e2101047d..e7e6dd25a 100644 --- a/src/github3/__about__.py +++ b/src/github3/__about__.py @@ -1,4 +1,5 @@ """The module that holds much of the metadata about github3.py.""" + __package_name__ = "github3.py" __title__ = "github3" __author__ = "Ian Stapleton Cordasco" diff --git a/src/github3/__init__.py b/src/github3/__init__.py index 78ff6a96f..f8cb24a11 100644 --- a/src/github3/__init__.py +++ b/src/github3/__init__.py @@ -8,6 +8,7 @@ :license: Modified BSD, see LICENSE for more details """ + from .__about__ import __author__ from .__about__ import __author_email__ from .__about__ import __copyright__ diff --git a/src/github3/api.py b/src/github3/api.py index 624da092c..55059ad50 100644 --- a/src/github3/api.py +++ b/src/github3/api.py @@ -6,6 +6,7 @@ :license: Modified BSD, see LICENSE for more details """ + from .github import GitHub from .github import GitHubEnterprise diff --git a/src/github3/apps.py b/src/github3/apps.py index a1cd6f08c..fc24a9c95 100644 --- a/src/github3/apps.py +++ b/src/github3/apps.py @@ -2,6 +2,7 @@ https://developer.github.com/apps/building-github-apps/ """ + import time import jwt diff --git a/src/github3/auths.py b/src/github3/auths.py index 9a2898c09..fceb2bdd5 100644 --- a/src/github3/auths.py +++ b/src/github3/auths.py @@ -1,4 +1,5 @@ """This module contains the Authorization object.""" + from .decorators import requires_basic_auth from .models import GitHubCore diff --git a/src/github3/checks.py b/src/github3/checks.py index f6974beb0..402d93b90 100644 --- a/src/github3/checks.py +++ b/src/github3/checks.py @@ -1,4 +1,5 @@ """This module contains all the classes relating to Checks.""" + from json import dumps from . import decorators diff --git a/src/github3/decorators.py b/src/github3/decorators.py index 4c8a081ef..ad06a60e8 100644 --- a/src/github3/decorators.py +++ b/src/github3/decorators.py @@ -1,4 +1,5 @@ """This module provides decorators to the rest of the library.""" + import os from functools import wraps from io import BytesIO as StringIO diff --git a/src/github3/events.py b/src/github3/events.py index d97d2faaf..60ed0315b 100644 --- a/src/github3/events.py +++ b/src/github3/events.py @@ -1,4 +1,5 @@ """This module contains the classes related to Events.""" + import copy from . import models diff --git a/src/github3/gists/__init__.py b/src/github3/gists/__init__.py index 73b64fd35..b10f2a41d 100644 --- a/src/github3/gists/__init__.py +++ b/src/github3/gists/__init__.py @@ -12,6 +12,7 @@ See also: http://developer.github.com/v3/gists/ """ + from .gist import Gist from .gist import ShortGist diff --git a/src/github3/gists/comment.py b/src/github3/gists/comment.py index c0d1a3907..9f6a18359 100644 --- a/src/github3/gists/comment.py +++ b/src/github3/gists/comment.py @@ -1,4 +1,5 @@ """Module containing the logic for a GistComment.""" + from .. import decorators from .. import models from .. import users diff --git a/src/github3/gists/file.py b/src/github3/gists/file.py index 820d56e99..1afbb6fe3 100644 --- a/src/github3/gists/file.py +++ b/src/github3/gists/file.py @@ -1,4 +1,5 @@ """Module containing the GistFile object.""" + from .. import models diff --git a/src/github3/gists/gist.py b/src/github3/gists/gist.py index 740277f64..9192843c6 100644 --- a/src/github3/gists/gist.py +++ b/src/github3/gists/gist.py @@ -1,4 +1,5 @@ """This module contains the Gist, ShortGist, and GistFork objects.""" + import typing as t from json import dumps diff --git a/src/github3/gists/history.py b/src/github3/gists/history.py index 61a81a69c..915ffd4ba 100644 --- a/src/github3/gists/history.py +++ b/src/github3/gists/history.py @@ -1,4 +1,5 @@ """Module containing the GistHistory object.""" + from .. import models from .. import users diff --git a/src/github3/git.py b/src/github3/git.py index 150ac9182..f46c6d4a5 100644 --- a/src/github3/git.py +++ b/src/github3/git.py @@ -3,6 +3,7 @@ See also: http://developer.github.com/v3/git/ """ + import base64 from json import dumps diff --git a/src/github3/github.py b/src/github3/github.py index c759b021c..1dfbf5f8d 100644 --- a/src/github3/github.py +++ b/src/github3/github.py @@ -1,4 +1,5 @@ """This module contains the main interfaces to the API.""" + import json import re import typing as t diff --git a/src/github3/issues/__init__.py b/src/github3/issues/__init__.py index a58f86e6a..4be94a912 100644 --- a/src/github3/issues/__init__.py +++ b/src/github3/issues/__init__.py @@ -6,6 +6,7 @@ See also: http://developer.github.com/v3/issues/ """ + from ..utils import timestamp_parameter from .issue import Issue from .issue import ShortIssue diff --git a/src/github3/issues/comment.py b/src/github3/issues/comment.py index 149dc815f..bc9727828 100644 --- a/src/github3/issues/comment.py +++ b/src/github3/issues/comment.py @@ -1,4 +1,5 @@ """Module with class(es) representing issue comments.""" + from .. import decorators from .. import models from .. import users diff --git a/src/github3/issues/event.py b/src/github3/issues/event.py index 356afb945..68cb5ea6d 100644 --- a/src/github3/issues/event.py +++ b/src/github3/issues/event.py @@ -1,4 +1,5 @@ """Issue events logic.""" + from .. import users from ..models import GitHubCore diff --git a/src/github3/issues/issue.py b/src/github3/issues/issue.py index ef96d9f39..1ac4df938 100644 --- a/src/github3/issues/issue.py +++ b/src/github3/issues/issue.py @@ -1,4 +1,5 @@ """Module containing the Issue logic.""" + from json import dumps from uritemplate import URITemplate # type: ignore diff --git a/src/github3/issues/label.py b/src/github3/issues/label.py index 065a1e481..93d2d98d8 100644 --- a/src/github3/issues/label.py +++ b/src/github3/issues/label.py @@ -1,4 +1,5 @@ """Module containing the logic for labels.""" + from json import dumps from ..decorators import requires_auth diff --git a/src/github3/licenses.py b/src/github3/licenses.py index 044950e23..89fc49f26 100644 --- a/src/github3/licenses.py +++ b/src/github3/licenses.py @@ -3,6 +3,7 @@ See also: https://developer.github.com/v3/licenses/ """ + import base64 from . import models diff --git a/src/github3/models.py b/src/github3/models.py index fc4635eea..46cfd754e 100644 --- a/src/github3/models.py +++ b/src/github3/models.py @@ -1,4 +1,5 @@ """This module provides the basic models used in github3.py.""" + import json as jsonlib import logging import typing as t diff --git a/src/github3/notifications.py b/src/github3/notifications.py index 11ddbf07a..0cd17f75d 100644 --- a/src/github3/notifications.py +++ b/src/github3/notifications.py @@ -3,6 +3,7 @@ See also: http://developer.github.com/v3/activity/notifications/ """ + from json import dumps from . import models diff --git a/src/github3/orgs.py b/src/github3/orgs.py index 96fcc8390..9ee09fd4b 100644 --- a/src/github3/orgs.py +++ b/src/github3/orgs.py @@ -1,4 +1,5 @@ """This module contains all of the classes related to organizations.""" + import typing as t from json import dumps diff --git a/src/github3/projects.py b/src/github3/projects.py index 0275fde97..1998cc43a 100644 --- a/src/github3/projects.py +++ b/src/github3/projects.py @@ -1,4 +1,5 @@ """This module contains all the classes relating to projects.""" + from json import dumps from . import exceptions diff --git a/src/github3/pulls.py b/src/github3/pulls.py index 8c6f91d54..86f5f2b48 100644 --- a/src/github3/pulls.py +++ b/src/github3/pulls.py @@ -1,4 +1,5 @@ """This module contains all the classes relating to pull requests.""" + from json import dumps from uritemplate import URITemplate # type: ignore diff --git a/src/github3/repos/__init__.py b/src/github3/repos/__init__.py index c453e6bae..4638934bb 100644 --- a/src/github3/repos/__init__.py +++ b/src/github3/repos/__init__.py @@ -6,6 +6,7 @@ See also: http://developer.github.com/v3/repos/ """ + from .repo import Repository from .repo import ShortRepository from .repo import StarredRepository diff --git a/src/github3/repos/branch.py b/src/github3/repos/branch.py index e0668fc78..1473f5136 100644 --- a/src/github3/repos/branch.py +++ b/src/github3/repos/branch.py @@ -1,4 +1,5 @@ """Implementation of a branch on a repository.""" + import typing as t from . import commit @@ -153,9 +154,9 @@ def protect( if allow_deletions is not None: edit["allow_deletions"] = allow_deletions if required_conversation_resolution is not None: - edit[ - "required_conversation_resolution" - ] = required_conversation_resolution + edit["required_conversation_resolution"] = ( + required_conversation_resolution + ) url = self._build_url("protection", base_url=self._api) resp = self._put(url, json=edit) json = self._json(resp, 200) diff --git a/src/github3/repos/comment.py b/src/github3/repos/comment.py index d03799262..a86f27d58 100644 --- a/src/github3/repos/comment.py +++ b/src/github3/repos/comment.py @@ -1,4 +1,5 @@ """This module contains the RepoComment class.""" + from .. import models from .. import users from ..decorators import requires_auth diff --git a/src/github3/repos/commit.py b/src/github3/repos/commit.py index ba79092e8..e59e3b7e6 100644 --- a/src/github3/repos/commit.py +++ b/src/github3/repos/commit.py @@ -1,4 +1,5 @@ """This module contains the RepoCommit classes.""" + from . import status from .. import checks from .. import git diff --git a/src/github3/repos/comparison.py b/src/github3/repos/comparison.py index 0406c4ea9..4455077be 100644 --- a/src/github3/repos/comparison.py +++ b/src/github3/repos/comparison.py @@ -1,4 +1,5 @@ """This module contains the Comparison object.""" + from . import commit from .. import models diff --git a/src/github3/repos/contents.py b/src/github3/repos/contents.py index 4ebaa42d5..f87b1b91a 100644 --- a/src/github3/repos/contents.py +++ b/src/github3/repos/contents.py @@ -1,4 +1,5 @@ """This module contains the Contents object.""" + from base64 import b64decode from base64 import b64encode from json import dumps diff --git a/src/github3/repos/deployment.py b/src/github3/repos/deployment.py index a8ec52544..3c8bc39af 100644 --- a/src/github3/repos/deployment.py +++ b/src/github3/repos/deployment.py @@ -1,4 +1,5 @@ """The module containing deployment logic.""" + from .. import users from ..models import GitHubCore diff --git a/src/github3/repos/hook.py b/src/github3/repos/hook.py index 4cc032360..aae36f8c9 100644 --- a/src/github3/repos/hook.py +++ b/src/github3/repos/hook.py @@ -1,4 +1,5 @@ """This module contains only the Hook object for GitHub's Hook API.""" + from json import dumps from ..decorators import requires_auth diff --git a/src/github3/repos/invitation.py b/src/github3/repos/invitation.py index 3ea646115..721777f3d 100644 --- a/src/github3/repos/invitation.py +++ b/src/github3/repos/invitation.py @@ -1,4 +1,5 @@ """Invitation related logic.""" + from json import dumps from .. import models diff --git a/src/github3/repos/issue_import.py b/src/github3/repos/issue_import.py index a1827246a..d85081ea7 100644 --- a/src/github3/repos/issue_import.py +++ b/src/github3/repos/issue_import.py @@ -1,4 +1,5 @@ """This module contains the logic for GitHub's import issue API.""" + from .. import models diff --git a/src/github3/repos/pages.py b/src/github3/repos/pages.py index d0b40586f..369f22377 100644 --- a/src/github3/repos/pages.py +++ b/src/github3/repos/pages.py @@ -1,4 +1,5 @@ """GitHub Pages related logic.""" + from .. import models diff --git a/src/github3/repos/release.py b/src/github3/repos/release.py index c731052c7..fad130a00 100644 --- a/src/github3/repos/release.py +++ b/src/github3/repos/release.py @@ -1,4 +1,5 @@ """Release logic for the GitHub API.""" + import json from uritemplate import URITemplate # type: ignore diff --git a/src/github3/repos/repo.py b/src/github3/repos/repo.py index 12fa01cbd..c5c66ab10 100644 --- a/src/github3/repos/repo.py +++ b/src/github3/repos/repo.py @@ -4,6 +4,7 @@ returned by GitHub. """ + import base64 import json as jsonlib diff --git a/src/github3/repos/stats.py b/src/github3/repos/stats.py index 588c24847..ef632657a 100644 --- a/src/github3/repos/stats.py +++ b/src/github3/repos/stats.py @@ -1,4 +1,5 @@ """Repository and contributor stats logic.""" + import datetime import dateutil.tz diff --git a/src/github3/repos/status.py b/src/github3/repos/status.py index ae39019d9..8584d8b04 100644 --- a/src/github3/repos/status.py +++ b/src/github3/repos/status.py @@ -1,4 +1,5 @@ """This module contains the Status object for GitHub's commit status API.""" + from .. import models from .. import users from ..models import GitHubCore diff --git a/src/github3/repos/tag.py b/src/github3/repos/tag.py index 9f093bbf7..83aba9688 100644 --- a/src/github3/repos/tag.py +++ b/src/github3/repos/tag.py @@ -1,4 +1,5 @@ """This module contains the RepoTag object for GitHub's tag API.""" + from . import commit from .. import models diff --git a/src/github3/repos/topics.py b/src/github3/repos/topics.py index 3ed884c37..06240e85b 100644 --- a/src/github3/repos/topics.py +++ b/src/github3/repos/topics.py @@ -1,4 +1,5 @@ """Topics related logic.""" + from .. import models diff --git a/src/github3/repos/traffic.py b/src/github3/repos/traffic.py index e2a200b27..2ed41f663 100644 --- a/src/github3/repos/traffic.py +++ b/src/github3/repos/traffic.py @@ -1,4 +1,5 @@ """Repository traffic stats logic.""" + from .. import models diff --git a/src/github3/search/code.py b/src/github3/search/code.py index e60eb4bd4..c9b1556ff 100644 --- a/src/github3/search/code.py +++ b/src/github3/search/code.py @@ -1,4 +1,5 @@ """Code search results implementation.""" + from .. import models from .. import repos diff --git a/src/github3/search/commit.py b/src/github3/search/commit.py index c80adf6ee..79c8c5081 100644 --- a/src/github3/search/commit.py +++ b/src/github3/search/commit.py @@ -1,4 +1,5 @@ """Commit search results implementation.""" + from .. import git from .. import models from .. import repos diff --git a/src/github3/search/issue.py b/src/github3/search/issue.py index 111f24e15..963488e60 100644 --- a/src/github3/search/issue.py +++ b/src/github3/search/issue.py @@ -1,4 +1,5 @@ """Issue search results implementation.""" + from ..issues import ShortIssue from ..models import GitHubCore diff --git a/src/github3/search/repository.py b/src/github3/search/repository.py index e2711da63..7a47a2f3e 100644 --- a/src/github3/search/repository.py +++ b/src/github3/search/repository.py @@ -1,4 +1,5 @@ """Repository search results implementation.""" + from .. import models from .. import repos diff --git a/src/github3/session.py b/src/github3/session.py index e51345f4a..1d4a70ec6 100644 --- a/src/github3/session.py +++ b/src/github3/session.py @@ -1,4 +1,5 @@ """Module containing session and auth logic.""" + import collections.abc as abc_collections import datetime from contextlib import contextmanager diff --git a/src/github3/structs.py b/src/github3/structs.py index 362844d79..4339bdc9f 100644 --- a/src/github3/structs.py +++ b/src/github3/structs.py @@ -157,7 +157,6 @@ def next(self) -> models.GitHubCore: class SearchIterator(GitHubIterator): - """This is a special-cased class for returning iterable search results. It inherits from :class:`GitHubIterator `. diff --git a/src/github3/users.py b/src/github3/users.py index dc47fcb6f..6dff5d769 100644 --- a/src/github3/users.py +++ b/src/github3/users.py @@ -1,4 +1,5 @@ """This module contains everything relating to Users.""" + import typing as t from json import dumps diff --git a/src/github3/utils.py b/src/github3/utils.py index 8bbb3ee4c..9027d9f81 100644 --- a/src/github3/utils.py +++ b/src/github3/utils.py @@ -1,4 +1,5 @@ """A collection of useful utilities.""" + import collections.abc as abc_collections import datetime import re diff --git a/tests/integration/test_auths.py b/tests/integration/test_auths.py index ed0b52fb3..298397ce3 100644 --- a/tests/integration/test_auths.py +++ b/tests/integration/test_auths.py @@ -1,10 +1,10 @@ """Integration tests for the github3.auths module.""" + import github3 from .helper import IntegrationHelper class TestAuthorization(IntegrationHelper): - """Integration tests for the Authorization class.""" def test_add_scopes(self): diff --git a/tests/integration/test_checks.py b/tests/integration/test_checks.py index 0b211d30a..69e4caec5 100644 --- a/tests/integration/test_checks.py +++ b/tests/integration/test_checks.py @@ -1,4 +1,5 @@ """Integration tests for methods implemented on Check* classes.""" + import datetime import dateutil diff --git a/tests/integration/test_gists.py b/tests/integration/test_gists.py index 2e76cc6d4..e801048b1 100644 --- a/tests/integration/test_gists.py +++ b/tests/integration/test_gists.py @@ -1,10 +1,10 @@ """Integration tests for methods implemented on Gist.""" + import github3 from .helper import IntegrationHelper class TestGist(IntegrationHelper): - """Gist integration tests.""" def test_comments(self): diff --git a/tests/integration/test_git.py b/tests/integration/test_git.py index 95084e3d6..8bd7a12aa 100644 --- a/tests/integration/test_git.py +++ b/tests/integration/test_git.py @@ -1,10 +1,10 @@ """Integration tests for Git.""" + import github3 from .helper import IntegrationHelper class TestTree(IntegrationHelper): - """Integration tests for methods on the Test class.""" def test_inequality(self): @@ -29,7 +29,6 @@ def test_recurse(self): class TestReference(IntegrationHelper): - """Integration tests for methods on the Reference class.""" def test_update(self): diff --git a/tests/integration/test_github.py b/tests/integration/test_github.py index 443576d64..1b9f84a42 100644 --- a/tests/integration/test_github.py +++ b/tests/integration/test_github.py @@ -1,4 +1,5 @@ """Integration tests for methods implemented on GitHub.""" + from datetime import datetime import pytest diff --git a/tests/integration/test_issue.py b/tests/integration/test_issue.py index fe4166101..fd80958ab 100644 --- a/tests/integration/test_issue.py +++ b/tests/integration/test_issue.py @@ -1,4 +1,5 @@ """Integration tests for Issues.""" + import pytest import github3 @@ -7,7 +8,6 @@ class TestIssue(IntegrationHelper): - """Integration tests for methods on the Issue class.""" def test_add_assignees(self): diff --git a/tests/integration/test_notifications.py b/tests/integration/test_notifications.py index a942db0d3..9627ed629 100644 --- a/tests/integration/test_notifications.py +++ b/tests/integration/test_notifications.py @@ -1,4 +1,5 @@ """Integration test for Notifications.""" + import github3 from .helper import IntegrationHelper diff --git a/tests/integration/test_orgs.py b/tests/integration/test_orgs.py index 06a3852ca..24478cb83 100644 --- a/tests/integration/test_orgs.py +++ b/tests/integration/test_orgs.py @@ -1,4 +1,5 @@ """Integration tests for methods implemented on Organization.""" + import pytest import github3 @@ -6,7 +7,6 @@ class TestOrganization(IntegrationHelper): - """Organization integration tests.""" betamax_kwargs = {"match_requests_on": ["method", "uri", "json-body"]} @@ -420,7 +420,6 @@ def test_hooks(self): class TestOrganizationHook(IntegrationHelper): - """Integration tests for OrganizationHook object.""" def test_delete(self): diff --git a/tests/integration/test_orgs_team.py b/tests/integration/test_orgs_team.py index abc45ecad..43bc3fbf9 100644 --- a/tests/integration/test_orgs_team.py +++ b/tests/integration/test_orgs_team.py @@ -1,10 +1,10 @@ """Integration tests for methods implemented on Team.""" + import github3 from .helper import IntegrationHelper class TestTeam(IntegrationHelper): - """Team integration tests.""" betamax_kwargs = {"match_requests_on": ["method", "uri", "json-body"]} diff --git a/tests/integration/test_projects.py b/tests/integration/test_projects.py index db65f1faf..6be5712e9 100644 --- a/tests/integration/test_projects.py +++ b/tests/integration/test_projects.py @@ -1,4 +1,5 @@ """Integration tests for methods implemented on Project.""" + import github3 from .helper import IntegrationHelper diff --git a/tests/integration/test_pulls.py b/tests/integration/test_pulls.py index d8f393de8..61527d49e 100644 --- a/tests/integration/test_pulls.py +++ b/tests/integration/test_pulls.py @@ -1,4 +1,5 @@ """Integration tests for methods implemented on PullRequest.""" + import github3 from .helper import IntegrationHelper from github3 import repos diff --git a/tests/integration/test_repos_branch.py b/tests/integration/test_repos_branch.py index b2196b8f9..63aef8055 100644 --- a/tests/integration/test_repos_branch.py +++ b/tests/integration/test_repos_branch.py @@ -1,4 +1,5 @@ """Integration tests for methods implemented on Branch.""" + from .helper import IntegrationHelper diff --git a/tests/integration/test_repos_commit.py b/tests/integration/test_repos_commit.py index de0e9ddea..e5081e2ea 100644 --- a/tests/integration/test_repos_commit.py +++ b/tests/integration/test_repos_commit.py @@ -1,4 +1,5 @@ """Integration tests for Repository Commit objects.""" + import github3 from . import helper diff --git a/tests/integration/test_repos_deployment.py b/tests/integration/test_repos_deployment.py index bcb0af7d2..663dbbdfb 100644 --- a/tests/integration/test_repos_deployment.py +++ b/tests/integration/test_repos_deployment.py @@ -1,4 +1,5 @@ """Deployment integration tests.""" + import github3 from .helper import IntegrationHelper @@ -9,7 +10,6 @@ def find(func, iterable): class TestDeployment(IntegrationHelper): - """Integration tests for the Deployment class.""" def test_create_status(self): diff --git a/tests/integration/test_repos_invitation.py b/tests/integration/test_repos_invitation.py index c90a4e1b7..2b47c6c75 100644 --- a/tests/integration/test_repos_invitation.py +++ b/tests/integration/test_repos_invitation.py @@ -1,4 +1,5 @@ """Integration tests for Repository Invitation objects.""" + import github3 from . import helper diff --git a/tests/integration/test_repos_repo.py b/tests/integration/test_repos_repo.py index b392db67b..2d3cffbab 100644 --- a/tests/integration/test_repos_repo.py +++ b/tests/integration/test_repos_repo.py @@ -1,4 +1,5 @@ """Integration tests for Repositories.""" + import datetime import itertools @@ -10,7 +11,6 @@ class TestRepository(helper.IntegrationHelper): - """Integration tests for the Repository object.""" def test_add_collaborator(self): @@ -1425,7 +1425,6 @@ def test_traffic_clones(self): class TestContents(helper.IntegrationHelper): - """Integration test for Contents object.""" def test_delete(self): @@ -1462,7 +1461,6 @@ def test_update(self): class TestHook(helper.IntegrationHelper): - """Integration tests for Hook object.""" def test_delete(self): @@ -1544,7 +1542,6 @@ def test_test(self): class TestRepoComment(helper.IntegrationHelper): - """Integration tests for RepoComment object.""" def test_delete(self): @@ -1577,7 +1574,6 @@ def test_edit(self): class TestRepoCommit(helper.IntegrationHelper): - """Integration tests for RepoCommit object.""" @pytest.mark.xfail @@ -1608,7 +1604,6 @@ def test_patch(self): class TestComparison(helper.IntegrationHelper): - """Integration test for Comparison object.""" @pytest.mark.xfail diff --git a/tests/integration/test_users.py b/tests/integration/test_users.py index ab7ffea10..dcba0f043 100644 --- a/tests/integration/test_users.py +++ b/tests/integration/test_users.py @@ -1,4 +1,5 @@ """Integration tests for the User class.""" + import datetime import pytest @@ -34,7 +35,6 @@ class TestGPGKey(IntegrationHelper): - """Integration tests for methods of the GPGKey class.""" def test_delete(self): @@ -79,7 +79,6 @@ def test_update(self): class TestUser(IntegrationHelper): - """Integration tests for methods on the User class.""" def test_events(self): diff --git a/tests/unit/helper.py b/tests/unit/helper.py index df9b477f2..6da14b7e9 100644 --- a/tests/unit/helper.py +++ b/tests/unit/helper.py @@ -1,4 +1,5 @@ """Base classes and helpers for unit tests.""" + import json import os.path import sys @@ -194,7 +195,6 @@ def after_setup(self): class UnitIteratorHelper(UnitHelper): - """Base class for iterator based unit tests.""" def create_session_mock(self, *args): @@ -255,7 +255,6 @@ def after_setup(self): class UnitSearchIteratorHelper(UnitIteratorHelper): - """Base class for search iterator based unit tests.""" def patch_get_json(self): @@ -284,7 +283,6 @@ def after_setup(self): class UnitRequiresAuthenticationHelper(UnitHelper): - """Helper for unit tests that demonstrate authentication is required.""" def after_setup(self): diff --git a/tests/unit/test_api.py b/tests/unit/test_api.py index 6203863b1..95e304ed9 100644 --- a/tests/unit/test_api.py +++ b/tests/unit/test_api.py @@ -1,11 +1,11 @@ """Unit tests for github3.api.""" + import unittest.mock import github3 class TestAPI(unittest.TestCase): - """All tests for the github3.api module.""" def test_enterprise_login(self): diff --git a/tests/unit/test_auths.py b/tests/unit/test_auths.py index 38836a8e0..ee280f8a9 100644 --- a/tests/unit/test_auths.py +++ b/tests/unit/test_auths.py @@ -1,4 +1,5 @@ """Unit tests for the auths module.""" + import github3 from . import helper @@ -6,7 +7,6 @@ class TestAuthorization(helper.UnitHelper): - """Authorization unit tests.""" described_class = github3.auths.Authorization @@ -51,7 +51,6 @@ def test_replace_scopes(self): class TestAuthorizationRequiresAuth(helper.UnitRequiresAuthenticationHelper): - """Test methods that require authentication on Authorization.""" described_class = github3.auths.Authorization diff --git a/tests/unit/test_checks.py b/tests/unit/test_checks.py index b5931f709..f4e0539a8 100644 --- a/tests/unit/test_checks.py +++ b/tests/unit/test_checks.py @@ -1,4 +1,5 @@ """Unit tests around github3's Checks classes.""" + from json import dumps import pytest diff --git a/tests/unit/test_gists.py b/tests/unit/test_gists.py index 5379caa09..7db20bb16 100644 --- a/tests/unit/test_gists.py +++ b/tests/unit/test_gists.py @@ -1,4 +1,5 @@ """Unit tests for the github3.gists module.""" + import pytest import github3 @@ -107,7 +108,6 @@ def test_to_str(self): class TestGistIssue883(helper.UnitHelper): - """Unit tests for the Gist object about issue 883.""" described_class = github3.gists.Gist diff --git a/tests/unit/test_git.py b/tests/unit/test_git.py index be589b87c..b22127c75 100644 --- a/tests/unit/test_git.py +++ b/tests/unit/test_git.py @@ -51,7 +51,6 @@ def test_recurse(self): class TestCommit(UnitHelper): - """Commit unit test.""" described_class = github3.git.Commit @@ -62,7 +61,6 @@ def test_repr(self): class TestGitTag(UnitHelper): - """Git Tag unit test.""" described_class = github3.git.Tag @@ -73,7 +71,6 @@ def test_repr(self): class TestReference(UnitHelper): - """Reference unit test.""" described_class = github3.git.Reference diff --git a/tests/unit/test_github.py b/tests/unit/test_github.py index dab91fb41..08f3d72e0 100644 --- a/tests/unit/test_github.py +++ b/tests/unit/test_github.py @@ -1308,7 +1308,6 @@ def test_repositories_by_with_type(self): class TestGitHubSearchIterators(helper.UnitSearchIteratorHelper): - """Test GitHub methods that return search iterators.""" described_class = GitHub @@ -1418,7 +1417,6 @@ def test_api_version_header_not_defined(_): class TestGitHubRequiresAuthentication( helper.UnitRequiresAuthenticationHelper ): - """Test methods that require authentication.""" described_class = GitHub diff --git a/tests/unit/test_issues_issue.py b/tests/unit/test_issues_issue.py index 65bbf6d06..ab0c8ea7c 100644 --- a/tests/unit/test_issues_issue.py +++ b/tests/unit/test_issues_issue.py @@ -1,4 +1,5 @@ """Unit tests for the Issue class.""" + import unittest.mock import dateutil.parser diff --git a/tests/unit/test_issues_milestone.py b/tests/unit/test_issues_milestone.py index 8ebb2cf64..0b28c5bc0 100644 --- a/tests/unit/test_issues_milestone.py +++ b/tests/unit/test_issues_milestone.py @@ -1,4 +1,5 @@ """Unit tests for the Milestone class.""" + import datetime import github3 @@ -92,7 +93,6 @@ def test_update_no_parameters(self): class TestMilestoneIterator(helper.UnitIteratorHelper): - """Test Milestone methods that return iterators.""" described_class = github3.issues.milestone.Milestone diff --git a/tests/unit/test_notifications.py b/tests/unit/test_notifications.py index 3d0f6435d..c4f7dbca3 100644 --- a/tests/unit/test_notifications.py +++ b/tests/unit/test_notifications.py @@ -1,4 +1,5 @@ """Unit tests around the Thread class.""" + import github3 from .helper import create_example_data_helper from .helper import create_url_helper diff --git a/tests/unit/test_orgs.py b/tests/unit/test_orgs.py index 9a34f3b01..c8096e2e7 100644 --- a/tests/unit/test_orgs.py +++ b/tests/unit/test_orgs.py @@ -1,4 +1,5 @@ """Organization unit tests.""" + import pytest from . import helper diff --git a/tests/unit/test_projects.py b/tests/unit/test_projects.py index 9bee8e9ce..326fbd750 100644 --- a/tests/unit/test_projects.py +++ b/tests/unit/test_projects.py @@ -1,4 +1,5 @@ """Unit tests for the github3.projects module.""" + import pytest from . import helper diff --git a/tests/unit/test_pulls.py b/tests/unit/test_pulls.py index 88ddd6f92..29b93c96f 100644 --- a/tests/unit/test_pulls.py +++ b/tests/unit/test_pulls.py @@ -1,4 +1,5 @@ """Unit tests for the github3.pulls module.""" + import pytest from . import helper diff --git a/tests/unit/test_repos_branch.py b/tests/unit/test_repos_branch.py index d9116f13c..eab56382e 100644 --- a/tests/unit/test_repos_branch.py +++ b/tests/unit/test_repos_branch.py @@ -1,4 +1,5 @@ """Unit tests for methods implemented on Branch.""" + import github3 from . import helper @@ -37,7 +38,6 @@ def test_unprotect(self): class TestBranchRequiresAuth(helper.UnitRequiresAuthenticationHelper): - """Unit tests for Branch methods that require authentication.""" described_class = github3.repos.branch.Branch diff --git a/tests/unit/test_repos_branch_protection.py b/tests/unit/test_repos_branch_protection.py index 5725c1add..24b4206e0 100644 --- a/tests/unit/test_repos_branch_protection.py +++ b/tests/unit/test_repos_branch_protection.py @@ -1,4 +1,5 @@ """Unit tests for methods implemented on Branch Protection.""" + import github3 from . import helper diff --git a/tests/unit/test_repos_commit.py b/tests/unit/test_repos_commit.py index 379eefcbc..208c9cfac 100644 --- a/tests/unit/test_repos_commit.py +++ b/tests/unit/test_repos_commit.py @@ -1,4 +1,5 @@ """Unit tests for Repository Commits.""" + import github3 from . import helper @@ -9,7 +10,6 @@ class TestRepoCommitIterator(helper.UnitIteratorHelper): - """Unit tests for RepoCommit iterator methods.""" described_class = github3.repos.commit.RepoCommit @@ -46,7 +46,6 @@ def test_associated_pull_requests(self): class TestRepoCommitIteratorAppInstAuth(helper.UnitIteratorAppInstHelper): - """Unit tests for RepoCommit iterator methods.""" described_class = github3.repos.commit.RepoCommit diff --git a/tests/unit/test_repos_deployment.py b/tests/unit/test_repos_deployment.py index f8c6a5710..d978684f2 100644 --- a/tests/unit/test_repos_deployment.py +++ b/tests/unit/test_repos_deployment.py @@ -1,4 +1,5 @@ """Unit tests for Deployment methods.""" + import github3 from .helper import create_example_data_helper from .helper import create_url_helper @@ -14,7 +15,6 @@ class TestDeploymentIterators(UnitIteratorHelper): - """Test Deployment methods that return iterators.""" described_class = github3.repos.deployment.Deployment diff --git a/tests/unit/test_repos_invitation.py b/tests/unit/test_repos_invitation.py index 38e46c8d4..e939ed1d1 100644 --- a/tests/unit/test_repos_invitation.py +++ b/tests/unit/test_repos_invitation.py @@ -1,4 +1,5 @@ """Unit tests for Repository Invitation objects.""" + import github3 from . import helper diff --git a/tests/unit/test_repos_release.py b/tests/unit/test_repos_release.py index 5656f4d56..839234aec 100644 --- a/tests/unit/test_repos_release.py +++ b/tests/unit/test_repos_release.py @@ -108,7 +108,6 @@ def test_upload_asset_with_a_label(self): class TestReleaseIterators(UnitIteratorHelper): - """Test iterator methods on the Release class.""" described_class = Release diff --git a/tests/unit/test_repos_repo.py b/tests/unit/test_repos_repo.py index e834514a9..d59a9a2a1 100644 --- a/tests/unit/test_repos_repo.py +++ b/tests/unit/test_repos_repo.py @@ -1,4 +1,5 @@ """Unit tests for Repositories.""" + import datetime import unittest.mock from base64 import b64encode @@ -67,7 +68,6 @@ class TestRepository(helper.UnitHelper): - """Unit test for regular Repository methods.""" described_class = Repository @@ -1026,7 +1026,6 @@ def test_clones_invalid_per(self): class TestRepositoryIterator(helper.UnitIteratorHelper): - """Unit tests for Repository methods that return iterators.""" described_class = Repository @@ -1468,7 +1467,6 @@ def test_teams(self): class TestRepositoryWithAppInstAuth(helper.UnitAppInstallHelper): - """Unit test for regular Repository methods.""" described_class = Repository @@ -1507,7 +1505,6 @@ def test_create_check_suite(self): class TestRepositoryRequiresAuth(helper.UnitRequiresAuthenticationHelper): - """Unit test for regular Repository methods.""" described_class = Repository @@ -1768,7 +1765,6 @@ def test_update_required_content(self): class TestContentsRequiresAuth(helper.UnitRequiresAuthenticationHelper): - """Unit test for Content methods that require Auth.""" described_class = Contents @@ -1789,7 +1785,6 @@ def test_update(self): class TestHook(helper.UnitHelper): - """Test methods on Hook class.""" described_class = Hook @@ -1843,7 +1838,6 @@ def test_test(self): class TestHookRequiresAuth(helper.UnitRequiresAuthenticationHelper): - """Test methods on Hook object that require authentication.""" described_class = Hook @@ -1876,7 +1870,6 @@ def test_test(self): class TestRepoComment(helper.UnitHelper): - """Unit test for methods on RepoComment object.""" example_data = comment_example_data @@ -1901,7 +1894,6 @@ def test_update(self): class TestRepoCommentRequiresAuth(helper.UnitRequiresAuthenticationHelper): - """ Unit test for methods that require authentication on RepoCommment object. @@ -1926,7 +1918,6 @@ def test_update(self): class TestRepoCommit(helper.UnitHelper): - """Unit tests for RepoCommit object.""" described_class = RepoCommit @@ -1959,7 +1950,6 @@ def test_str(self): class TestComparison(helper.UnitHelper): - """Unit test for Comparison object.""" described_class = Comparison @@ -1989,7 +1979,6 @@ def test_str(self): class TestRepositoryCompatibility_2_12(helper.UnitIteratorHelper): - """Unit tests for Repository from Github Enterprise 2.12""" described_class = Repository diff --git a/tests/unit/test_repos_status.py b/tests/unit/test_repos_status.py index cc2f2cf9c..22f25fb5a 100644 --- a/tests/unit/test_repos_status.py +++ b/tests/unit/test_repos_status.py @@ -8,7 +8,6 @@ class TestCombinedStatus(UnitHelper): - """Commit unit test.""" described_class = github3.repos.status.CombinedStatus diff --git a/tests/unit/test_subscription.py b/tests/unit/test_subscription.py index 914ec0666..7d3aaf7eb 100644 --- a/tests/unit/test_subscription.py +++ b/tests/unit/test_subscription.py @@ -1,4 +1,5 @@ """Unit tests around github3's Subscription classes.""" + import github3 from .helper import create_example_data_helper from .helper import create_url_helper diff --git a/tests/unit/test_users.py b/tests/unit/test_users.py index b7f84c6e8..bbeec4c38 100644 --- a/tests/unit/test_users.py +++ b/tests/unit/test_users.py @@ -33,7 +33,6 @@ class TestUser(helper.UnitHelper): - """Test methods on User class.""" described_class = github3.users.User @@ -68,7 +67,6 @@ def test_is_following(self): class TestUserGPGKeyRequiresAuth(helper.UnitRequiresAuthenticationHelper): - """Unit tests that demonstrate which GPGKey methods require auth.""" described_class = github3.users.GPGKey @@ -80,7 +78,6 @@ def test_delete(self): class TestUserGPGKey(helper.UnitHelper): - """Unit tests for the GPGKey object.""" described_class = github3.users.GPGKey @@ -94,7 +91,6 @@ def test_delete(self): class TestUserKeyRequiresAuth(helper.UnitRequiresAuthenticationHelper): - """Test that ensure certain methods on Key class requires auth.""" described_class = github3.users.Key @@ -112,7 +108,6 @@ def test_delete(self): class TestUserKey(helper.UnitHelper): - """Test methods on Key class.""" described_class = github3.users.Key @@ -144,7 +139,6 @@ def test_update(self): class TestUserIterators(helper.UnitIteratorHelper): - """Test User methods that return iterators.""" described_class = github3.users.User @@ -264,7 +258,6 @@ def test_subscriptions(self): class TestUsersRequiresAuth(helper.UnitRequiresAuthenticationHelper): - """Test that ensure certain methods on the User class requires auth.""" described_class = github3.users.User @@ -277,7 +270,6 @@ def test_organization_events(self): class TestPlan(helper.UnitHelper): - """Test for methods on Plan class.""" described_class = github3.users.Plan @@ -294,7 +286,6 @@ def test_is_free(self): class TestAuthenticatedUserCompatibility_2_12(helper.UnitHelper): - """Test methods on AuthenticatedUser from Github Enterprise 2.12.""" described_class = github3.users.AuthenticatedUser