From e113e37de1ec687c68337d777f3629251b35ab28 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 15 Dec 2020 14:07:33 +1100 Subject: [PATCH] Add pyupgrade to pre-commit configuration (#1783) To help us switch to f-strings and other 3.6+ changes, add pyupgrade to our pre-commit configuration to keep the codebase clean. --- .pre-commit-config.yaml | 6 + doc/conf.py | 14 +- github/AccessToken.py | 2 - github/ApplicationOAuth.py | 4 +- github/AuthenticatedUser.py | 2 - github/Authorization.py | 2 - github/AuthorizationApplication.py | 2 - github/Branch.py | 2 - github/BranchProtection.py | 2 - github/CheckRun.py | 2 - github/CheckRunAnnotation.py | 2 - github/CheckRunOutput.py | 2 - github/CheckSuite.py | 2 - github/Clones.py | 2 - github/Commit.py | 2 - github/CommitCombinedStatus.py | 2 - github/CommitComment.py | 2 - github/CommitStats.py | 2 - github/CommitStatus.py | 2 - github/Comparison.py | 2 - github/Consts.py | 2 - github/ContentFile.py | 2 - github/Deployment.py | 2 - github/DeploymentStatus.py | 2 - github/Download.py | 2 - github/Event.py | 2 - github/File.py | 2 - github/Gist.py | 2 - github/GistComment.py | 2 - github/GistFile.py | 2 - github/GistHistoryState.py | 2 - github/GitAuthor.py | 2 - github/GitBlob.py | 2 - github/GitCommit.py | 2 - github/GitObject.py | 2 - github/GitRef.py | 2 - github/GitRelease.py | 2 - github/GitReleaseAsset.py | 2 - github/GitTag.py | 2 - github/GitTree.py | 2 - github/GitTreeElement.py | 2 - github/GithubApp.py | 2 - github/GithubException.py | 2 - github/GithubObject.py | 17 +- github/GitignoreTemplate.py | 2 - github/Hook.py | 2 - github/HookDescription.py | 2 - github/HookResponse.py | 2 - github/InputFileContent.py | 4 +- github/InputGitAuthor.py | 6 +- github/InputGitTreeElement.py | 4 +- github/Installation.py | 2 - github/InstallationAuthorization.py | 2 - github/Invitation.py | 2 - github/Issue.py | 2 - github/IssueComment.py | 2 - github/IssueEvent.py | 2 - github/IssuePullRequest.py | 2 - github/Label.py | 2 - github/License.py | 2 - github/MainClass.py | 38 ++-- github/Membership.py | 2 - github/Migration.py | 2 - github/Milestone.py | 2 - github/NamedUser.py | 2 - github/Notification.py | 2 - github/NotificationSubject.py | 2 - github/Organization.py | 2 - github/PaginatedList.py | 8 +- github/Path.py | 2 - github/Permissions.py | 2 - github/Plan.py | 2 - github/Project.py | 2 - github/ProjectCard.py | 2 - github/ProjectColumn.py | 2 - github/PullRequest.py | 2 - github/PullRequestComment.py | 2 - github/PullRequestMergeStatus.py | 2 - github/PullRequestPart.py | 2 - github/PullRequestReview.py | 2 - github/Rate.py | 2 - github/RateLimit.py | 2 - github/Reaction.py | 2 - github/Referrer.py | 2 - github/Repository.py | 2 - github/RepositoryKey.py | 2 - github/RepositoryPreferences.py | 2 - github/Requester.py | 12 +- github/RequiredPullRequestReviews.py | 2 - github/RequiredStatusChecks.py | 2 - github/SelfHostedActionsRunner.py | 2 - github/SourceImport.py | 2 - github/Stargazer.py | 2 - github/StatsCodeFrequency.py | 2 - github/StatsCommitActivity.py | 2 - github/StatsContributor.py | 2 - github/StatsParticipation.py | 2 - github/StatsPunchCard.py | 2 - github/Tag.py | 2 - github/Team.py | 2 - github/TeamDiscussion.py | 2 - github/TimelineEvent.py | 2 - github/TimelineEventSource.py | 2 - github/Topic.py | 2 - github/UserKey.py | 2 - github/View.py | 2 - github/Workflow.py | 2 - github/WorkflowRun.py | 2 - github/__init__.py | 2 - scripts/add_attribute.py | 1 - scripts/fix_headers.py | 1 - setup.py | 1 - tests/ApplicationOAuth.py | 10 +- tests/AuthenticatedUser.py | 2 - tests/Authentication.py | 2 - tests/Authorization.py | 2 - tests/BadAttributes.py | 288 +++++++++++++-------------- tests/Branch.py | 38 ++-- tests/BranchProtection.py | 2 - tests/CheckRun.py | 2 - tests/CheckSuite.py | 2 - tests/Commit.py | 2 - tests/CommitCombinedStatus.py | 2 - tests/CommitComment.py | 2 - tests/CommitStatus.py | 2 - tests/ConditionalRequestUpdate.py | 2 - tests/Connection.py | 10 +- tests/ContentFile.py | 2 - tests/Deployment.py | 2 - tests/DeploymentStatus.py | 2 - tests/Download.py | 2 - tests/Enterprise.py | 2 - tests/Equality.py | 2 - tests/Event.py | 2 - tests/Exceptions.py | 2 - tests/ExposeAllAttributes.py | 2 - tests/Framework.py | 6 +- tests/Gist.py | 2 - tests/GistComment.py | 2 - tests/GitBlob.py | 2 - tests/GitCommit.py | 2 - tests/GitMembership.py | 2 - tests/GitRef.py | 2 - tests/GitRelease.py | 4 +- tests/GitTag.py | 2 - tests/GitTree.py | 2 - tests/GithubApp.py | 2 - tests/GithubIntegration.py | 52 ++--- tests/Github_.py | 2 - tests/Hook.py | 2 - tests/Issue.py | 2 - tests/Issue131.py | 2 - tests/Issue133.py | 2 - tests/Issue134.py | 2 - tests/Issue139.py | 2 - tests/Issue140.py | 2 - tests/Issue142.py | 2 - tests/Issue158.py | 2 - tests/Issue174.py | 2 - tests/Issue214.py | 2 - tests/Issue216.py | 2 - tests/Issue278.py | 2 - tests/Issue33.py | 2 - tests/Issue494.py | 6 +- tests/Issue50.py | 2 - tests/Issue54.py | 2 - tests/Issue572.py | 2 - tests/Issue80.py | 2 - tests/Issue823.py | 2 - tests/Issue87.py | 2 - tests/Issue937.py | 2 - tests/Issue945.py | 2 - tests/IssueComment.py | 2 - tests/IssueEvent.py | 12 +- tests/Label.py | 2 - tests/License.py | 2 - tests/Logging_.py | 4 +- tests/Markdown.py | 2 - tests/Migration.py | 2 - tests/Milestone.py | 2 - tests/NamedUser.py | 2 - tests/NamedUser1430.py | 2 - tests/Notification.py | 2 - tests/Organization.py | 6 +- tests/Organization1437.py | 2 - tests/OrganizationHasInMembers.py | 2 - tests/PaginatedList.py | 2 - tests/Persistence.py | 2 - tests/Project.py | 2 - tests/Project1434.py | 2 - tests/ProjectColumn.py | 2 - tests/PullRequest.py | 2 - tests/PullRequest1168.py | 2 - tests/PullRequest1169.py | 2 - tests/PullRequest1375.py | 2 - tests/PullRequest1682.py | 2 - tests/PullRequestComment.py | 2 - tests/PullRequestFile.py | 2 - tests/PullRequestReview.py | 2 - tests/RateLimiting.py | 2 - tests/RawData.py | 2 - tests/Reaction.py | 2 - tests/ReleaseAsset.py | 2 - tests/Repository.py | 24 +-- tests/RepositoryKey.py | 2 - tests/RequiredPullRequestReviews.py | 2 - tests/RequiredStatusChecks.py | 2 - tests/Retry.py | 2 - tests/Search.py | 232 +++++++++++---------- tests/SelfHostedActionsRunner.py | 2 - tests/SourceImport.py | 2 - tests/Tag.py | 2 - tests/Team.py | 2 - tests/Topic.py | 4 +- tests/Traffic.py | 2 - tests/UserKey.py | 2 - tests/Workflow.py | 2 - tests/WorkflowRun.py | 2 - tests/__init__.py | 2 - tests/conftest.py | 2 - 220 files changed, 383 insertions(+), 815 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c1b18c58..e18dd1f9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,3 +24,9 @@ repos: args: - --ignore-words-list="bloaded,nto,pullrequest,pullrequests,thi,tim,wan,Wan,chang,Chang" - --quiet-level=2 + - repo: https://github.com/asottile/pyupgrade + rev: v2.7.4 + hooks: + - id: pyupgrade + args: + - --py36-plus diff --git a/doc/conf.py b/doc/conf.py index a763b9dd..b8187945 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # @@ -61,8 +59,8 @@ source_suffix = ".rst" master_doc = "index" # General information about the project. -project = u"PyGithub" -copyright = u"%d, Vincent Jacques" % datetime.date.today().year +project = "PyGithub" +copyright = "%d, Vincent Jacques" % datetime.date.today().year # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -204,7 +202,7 @@ htmlhelp_basename = "PyGithubdoc" # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ("index", "PyGithub.tex", u"PyGithub Documentation", u"Vincent Jacques", "manual"), + ("index", "PyGithub.tex", "PyGithub Documentation", "Vincent Jacques", "manual"), ] # The name of an image file (relative to this directory) to place at the top of @@ -232,7 +230,7 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [("index", "pygithub", u"PyGithub Documentation", [u"Vincent Jacques"], 1)] +man_pages = [("index", "pygithub", "PyGithub Documentation", ["Vincent Jacques"], 1)] # If true, show URL addresses after external links. # man_show_urls = False @@ -247,8 +245,8 @@ texinfo_documents = [ ( "index", "PyGithub", - u"PyGithub Documentation", - u"Vincent Jacques", + "PyGithub Documentation", + "Vincent Jacques", "PyGithub", "One line description of project.", "Miscellaneous", diff --git a/github/AccessToken.py b/github/AccessToken.py index 8ebbe277..f2fb64f4 100644 --- a/github/AccessToken.py +++ b/github/AccessToken.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2019 Rigas Papathanasopoulos # diff --git a/github/ApplicationOAuth.py b/github/ApplicationOAuth.py index 0afe771a..2d1f81d9 100644 --- a/github/ApplicationOAuth.py +++ b/github/ApplicationOAuth.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ########################### # # # Copyright 2019 Rigas Papathanasopoulos # @@ -75,7 +73,7 @@ class ApplicationOAuth(github.GithubObject.NonCompletableGithubObject): parameters = urllib.parse.urlencode(parameters) base_url = "https://github.com/login/oauth/authorize" - return u"{}?{}".format(base_url, parameters) + return f"{base_url}?{parameters}" def get_access_token(self, code, state=None): """ diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 2bfdf803..58a5c5d6 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Steve English # diff --git a/github/Authorization.py b/github/Authorization.py index 3b3c9fbe..bbddd170 100644 --- a/github/Authorization.py +++ b/github/Authorization.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/AuthorizationApplication.py b/github/AuthorizationApplication.py index c6b9bc50..38dd6509 100644 --- a/github/AuthorizationApplication.py +++ b/github/AuthorizationApplication.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/Branch.py b/github/Branch.py index 298b40b3..f723301c 100644 --- a/github/Branch.py +++ b/github/Branch.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/BranchProtection.py b/github/BranchProtection.py index 9ff7f162..ffc364c8 100644 --- a/github/BranchProtection.py +++ b/github/BranchProtection.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Steve Kowalik # diff --git a/github/CheckRun.py b/github/CheckRun.py index 18403130..9a895980 100644 --- a/github/CheckRun.py +++ b/github/CheckRun.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Dhruv Manilawala # diff --git a/github/CheckRunAnnotation.py b/github/CheckRunAnnotation.py index a1e833d4..5c7033cd 100644 --- a/github/CheckRunAnnotation.py +++ b/github/CheckRunAnnotation.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Dhruv Manilawala # diff --git a/github/CheckRunOutput.py b/github/CheckRunOutput.py index 35cd9ed7..3dfc0238 100644 --- a/github/CheckRunOutput.py +++ b/github/CheckRunOutput.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Dhruv Manilawala # diff --git a/github/CheckSuite.py b/github/CheckSuite.py index fb990fdf..d6d67c32 100644 --- a/github/CheckSuite.py +++ b/github/CheckSuite.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Raju Subramanian # diff --git a/github/Clones.py b/github/Clones.py index 1a2a1fe6..bf07b60b 100644 --- a/github/Clones.py +++ b/github/Clones.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Justin Kufro # diff --git a/github/Commit.py b/github/Commit.py index 0e39a9ae..f951589d 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/CommitCombinedStatus.py b/github/CommitCombinedStatus.py index c7c02a3c..fb420d86 100644 --- a/github/CommitCombinedStatus.py +++ b/github/CommitCombinedStatus.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2016 Jannis Gebauer # diff --git a/github/CommitComment.py b/github/CommitComment.py index c2d1fba7..f5eca565 100644 --- a/github/CommitComment.py +++ b/github/CommitComment.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/CommitStats.py b/github/CommitStats.py index e98fb210..2a511c8a 100644 --- a/github/CommitStats.py +++ b/github/CommitStats.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/CommitStatus.py b/github/CommitStatus.py index f6325e93..b95b49e4 100644 --- a/github/CommitStatus.py +++ b/github/CommitStatus.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/Comparison.py b/github/Comparison.py index 3a0eb4bd..f058b7e3 100644 --- a/github/Comparison.py +++ b/github/Comparison.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/Consts.py b/github/Consts.py index f5327ef4..d5cbcb7e 100644 --- a/github/Consts.py +++ b/github/Consts.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 AKFish # diff --git a/github/ContentFile.py b/github/ContentFile.py index 68faab8b..8d3289ae 100644 --- a/github/ContentFile.py +++ b/github/ContentFile.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/Deployment.py b/github/Deployment.py index 7b885f10..9e959d09 100644 --- a/github/Deployment.py +++ b/github/Deployment.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Steve Kowalik # diff --git a/github/DeploymentStatus.py b/github/DeploymentStatus.py index c763aecd..518f0b4a 100644 --- a/github/DeploymentStatus.py +++ b/github/DeploymentStatus.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Colby Gallup # diff --git a/github/Download.py b/github/Download.py index 82871a0e..5c7932ea 100644 --- a/github/Download.py +++ b/github/Download.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/Event.py b/github/Event.py index a97299a1..f690d802 100644 --- a/github/Event.py +++ b/github/Event.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/File.py b/github/File.py index f040ac75..cc07442c 100644 --- a/github/File.py +++ b/github/File.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/Gist.py b/github/Gist.py index ca0e0a82..88b799a3 100644 --- a/github/Gist.py +++ b/github/Gist.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Steve English # diff --git a/github/GistComment.py b/github/GistComment.py index ec06caa3..7bf85ec5 100644 --- a/github/GistComment.py +++ b/github/GistComment.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/GistFile.py b/github/GistFile.py index c9245116..f540e154 100644 --- a/github/GistFile.py +++ b/github/GistFile.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/GistHistoryState.py b/github/GistHistoryState.py index ade2f3dd..5cb96908 100644 --- a/github/GistHistoryState.py +++ b/github/GistHistoryState.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/GitAuthor.py b/github/GitAuthor.py index d7f5dc8a..56f7a322 100644 --- a/github/GitAuthor.py +++ b/github/GitAuthor.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/GitBlob.py b/github/GitBlob.py index 2db328d9..c93e8c63 100644 --- a/github/GitBlob.py +++ b/github/GitBlob.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/GitCommit.py b/github/GitCommit.py index 7c50847d..0a7aa6d8 100644 --- a/github/GitCommit.py +++ b/github/GitCommit.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/GitObject.py b/github/GitObject.py index ce2fd71f..02eb49af 100644 --- a/github/GitObject.py +++ b/github/GitObject.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/GitRef.py b/github/GitRef.py index 6216fab7..69222b7d 100644 --- a/github/GitRef.py +++ b/github/GitRef.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/GitRelease.py b/github/GitRelease.py index c7a711e2..31a45edc 100644 --- a/github/GitRelease.py +++ b/github/GitRelease.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2015 Ed Holland # diff --git a/github/GitReleaseAsset.py b/github/GitReleaseAsset.py index a8678ae9..7271b552 100644 --- a/github/GitReleaseAsset.py +++ b/github/GitReleaseAsset.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2017 Chris McBride # diff --git a/github/GitTag.py b/github/GitTag.py index b6eeafb3..eb0bf65d 100644 --- a/github/GitTag.py +++ b/github/GitTag.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/GitTree.py b/github/GitTree.py index ebb35270..6afc1303 100644 --- a/github/GitTree.py +++ b/github/GitTree.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/GitTreeElement.py b/github/GitTreeElement.py index cf7d21e8..9da5e033 100644 --- a/github/GitTreeElement.py +++ b/github/GitTreeElement.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/GithubApp.py b/github/GithubApp.py index f0387e41..cac31f24 100644 --- a/github/GithubApp.py +++ b/github/GithubApp.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Raju Subramanian # diff --git a/github/GithubException.py b/github/GithubException.py index c972c7f9..4708047f 100644 --- a/github/GithubException.py +++ b/github/GithubException.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/GithubObject.py b/github/GithubObject.py index 81b6a203..3916153e 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # @@ -66,7 +64,7 @@ class _BadAttribute: ) -class GithubObject(object): +class GithubObject: """ Base class for all classes representing objects returned by the API. """ @@ -233,13 +231,10 @@ class GithubObject(object): for key, element in value.items() ): return _ValuedAttribute( - dict( - ( - key, - klass(self._requester, self._headers, element, completed=False), - ) + { + key: klass(self._requester, self._headers, element, completed=False) for key, element in value.items() - ) + } ) else: return _BadAttribute(value, {str: dict}) @@ -269,8 +264,8 @@ class GithubObject(object): if isinstance(v, bytes): v = v.decode("utf-8") if isinstance(v, str): - v = '"{v}"'.format(v=v) - yield u"{k}={v}".format(k=k, v=v) + v = f'"{v}"' + yield f"{k}={v}" return "{class_name}({params})".format( class_name=self.__class__.__name__, diff --git a/github/GitignoreTemplate.py b/github/GitignoreTemplate.py index 79c708be..147276a9 100644 --- a/github/GitignoreTemplate.py +++ b/github/GitignoreTemplate.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/Hook.py b/github/Hook.py index 75c5473c..346dc04c 100644 --- a/github/Hook.py +++ b/github/Hook.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/HookDescription.py b/github/HookDescription.py index 6db95c7a..44ec8af4 100644 --- a/github/HookDescription.py +++ b/github/HookDescription.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/HookResponse.py b/github/HookResponse.py index 72b02375..a491ef30 100644 --- a/github/HookResponse.py +++ b/github/HookResponse.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/InputFileContent.py b/github/InputFileContent.py index 1c2cc77d..3289d187 100644 --- a/github/InputFileContent.py +++ b/github/InputFileContent.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # @@ -31,7 +29,7 @@ import github.GithubObject -class InputFileContent(object): +class InputFileContent: """ This class represents InputFileContents """ diff --git a/github/InputGitAuthor.py b/github/InputGitAuthor.py index 17b54902..b53fd46d 100644 --- a/github/InputGitAuthor.py +++ b/github/InputGitAuthor.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # @@ -33,7 +31,7 @@ import github.GithubObject -class InputGitAuthor(object): +class InputGitAuthor: """ This class represents InputGitAuthors """ @@ -56,7 +54,7 @@ class InputGitAuthor(object): self.__date = date def __repr__(self): - return 'InputGitAuthor(name="{}")'.format(self.__name) + return f'InputGitAuthor(name="{self.__name}")' @property def _identity(self): diff --git a/github/InputGitTreeElement.py b/github/InputGitTreeElement.py index 75284ebd..909250c5 100644 --- a/github/InputGitTreeElement.py +++ b/github/InputGitTreeElement.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # @@ -31,7 +29,7 @@ import github.GithubObject -class InputGitTreeElement(object): +class InputGitTreeElement: """ This class represents InputGitTreeElements """ diff --git a/github/Installation.py b/github/Installation.py index 785d9394..5ec75503 100644 --- a/github/Installation.py +++ b/github/Installation.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2017 Jannis Gebauer # diff --git a/github/InstallationAuthorization.py b/github/InstallationAuthorization.py index addd2839..06c695f9 100644 --- a/github/InstallationAuthorization.py +++ b/github/InstallationAuthorization.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2016 Jannis Gebauer # diff --git a/github/Invitation.py b/github/Invitation.py index c31e6898..d246dcfb 100644 --- a/github/Invitation.py +++ b/github/Invitation.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2017 Jannis Gebauer # diff --git a/github/Issue.py b/github/Issue.py index 641a3332..078f2182 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Andrew Bettison # diff --git a/github/IssueComment.py b/github/IssueComment.py index 093412fb..85162b0d 100644 --- a/github/IssueComment.py +++ b/github/IssueComment.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/IssueEvent.py b/github/IssueEvent.py index 250a87c0..35456e86 100644 --- a/github/IssueEvent.py +++ b/github/IssueEvent.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/IssuePullRequest.py b/github/IssuePullRequest.py index f35f4da0..b7d73da6 100644 --- a/github/IssuePullRequest.py +++ b/github/IssuePullRequest.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/Label.py b/github/Label.py index 2d316e72..881ce014 100644 --- a/github/Label.py +++ b/github/Label.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/License.py b/github/License.py index f9ed8843..c6040379 100644 --- a/github/License.py +++ b/github/License.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Wan Liuyang # diff --git a/github/MainClass.py b/github/MainClass.py index 65c94364..ceac54e0 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 AKFish # @@ -90,7 +88,7 @@ DEFAULT_TIMEOUT = 15 DEFAULT_PER_PAGE = 30 -class Github(object): +class Github: """ This is the main class you instantiate to access the Github API v3. Optional parameters allow different authentication methods. """ @@ -339,13 +337,13 @@ class Github(object): """ assert isinstance(full_name_or_id, (str, int)), full_name_or_id url_base = "/repositories/" if isinstance(full_name_or_id, int) else "/repos/" - url = "%s%s" % (url_base, full_name_or_id) + url = f"{url_base}{full_name_or_id}" if lazy: return Repository.Repository( self.__requester, {}, {"url": url}, completed=False ) headers, data = self.__requester.requestJsonAndCheck( - "GET", "%s%s" % (url_base, full_name_or_id) + "GET", f"{url_base}{full_name_or_id}" ) return Repository.Repository(self.__requester, headers, data, completed=True) @@ -431,7 +429,7 @@ class Github(object): query, sort=github.GithubObject.NotSet, order=github.GithubObject.NotSet, - **qualifiers + **qualifiers, ): """ :calls: `GET /search/repositories `_ @@ -459,7 +457,7 @@ class Github(object): query_chunks.append(query) for qualifier, value in qualifiers.items(): - query_chunks.append("%s:%s" % (qualifier, value)) + query_chunks.append(f"{qualifier}:{value}") url_parameters["q"] = " ".join(query_chunks) assert url_parameters["q"], "need at least one qualifier" @@ -476,7 +474,7 @@ class Github(object): query, sort=github.GithubObject.NotSet, order=github.GithubObject.NotSet, - **qualifiers + **qualifiers, ): """ :calls: `GET /search/users `_ @@ -500,7 +498,7 @@ class Github(object): query_chunks.append(query) for qualifier, value in qualifiers.items(): - query_chunks.append("%s:%s" % (qualifier, value)) + query_chunks.append(f"{qualifier}:{value}") url_parameters["q"] = " ".join(query_chunks) assert url_parameters["q"], "need at least one qualifier" @@ -517,7 +515,7 @@ class Github(object): query, sort=github.GithubObject.NotSet, order=github.GithubObject.NotSet, - **qualifiers + **qualifiers, ): """ :calls: `GET /search/issues `_ @@ -541,7 +539,7 @@ class Github(object): query_chunks.append(query) for qualifier, value in qualifiers.items(): - query_chunks.append("%s:%s" % (qualifier, value)) + query_chunks.append(f"{qualifier}:{value}") url_parameters["q"] = " ".join(query_chunks) assert url_parameters["q"], "need at least one qualifier" @@ -556,7 +554,7 @@ class Github(object): sort=github.GithubObject.NotSet, order=github.GithubObject.NotSet, highlight=False, - **qualifiers + **qualifiers, ): """ :calls: `GET /search/code `_ @@ -585,7 +583,7 @@ class Github(object): query_chunks.append(query) for qualifier, value in qualifiers.items(): - query_chunks.append("%s:%s" % (qualifier, value)) + query_chunks.append(f"{qualifier}:{value}") url_parameters["q"] = " ".join(query_chunks) assert url_parameters["q"], "need at least one qualifier" @@ -605,7 +603,7 @@ class Github(object): query, sort=github.GithubObject.NotSet, order=github.GithubObject.NotSet, - **qualifiers + **qualifiers, ): """ :calls: `GET /search/commits `_ @@ -633,7 +631,7 @@ class Github(object): query_chunks.append(query) for qualifier, value in qualifiers.items(): - query_chunks.append("%s:%s" % (qualifier, value)) + query_chunks.append(f"{qualifier}:{value}") url_parameters["q"] = " ".join(query_chunks) assert url_parameters["q"], "need at least one qualifier" @@ -661,7 +659,7 @@ class Github(object): query_chunks.append(query) for qualifier, value in qualifiers.items(): - query_chunks.append("%s:%s" % (qualifier, value)) + query_chunks.append(f"{qualifier}:{value}") url_parameters["q"] = " ".join(query_chunks) assert url_parameters["q"], "need at least one qualifier" @@ -809,7 +807,7 @@ class Github(object): return GithubApp.GithubApp(self.__requester, headers, data, completed=True) -class GithubIntegration(object): +class GithubIntegration: """ Main class to obtain tokens for a GitHub integration. """ @@ -858,7 +856,7 @@ class GithubIntegration(object): self.base_url, installation_id ), headers={ - "Authorization": "Bearer {}".format(self.create_jwt()), + "Authorization": f"Bearer {self.create_jwt()}", "Accept": Consts.mediaTypeIntegrationPreview, "User-Agent": "PyGithub/Python", }, @@ -892,13 +890,13 @@ class GithubIntegration(object): :rtype: :class:`github.Installation.Installation` """ headers = { - "Authorization": "Bearer {}".format(self.create_jwt()), + "Authorization": f"Bearer {self.create_jwt()}", "Accept": Consts.mediaTypeIntegrationPreview, "User-Agent": "PyGithub/Python", } response = requests.get( - "{}/repos/{}/{}/installation".format(self.base_url, owner, repo), + f"{self.base_url}/repos/{owner}/{repo}/installation", headers=headers, ) response_dict = response.json() diff --git a/github/Membership.py b/github/Membership.py index 2c45de68..6eccb343 100644 --- a/github/Membership.py +++ b/github/Membership.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Steve English # diff --git a/github/Migration.py b/github/Migration.py index 02b8c958..642de5f7 100644 --- a/github/Migration.py +++ b/github/Migration.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/Milestone.py b/github/Milestone.py index 4362a47c..3f3f9829 100644 --- a/github/Milestone.py +++ b/github/Milestone.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/NamedUser.py b/github/NamedUser.py index 990c513a..98e4e29d 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Steve English # diff --git a/github/Notification.py b/github/Notification.py index 6497d707..7f427c8b 100644 --- a/github/Notification.py +++ b/github/Notification.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 AKFish # diff --git a/github/NotificationSubject.py b/github/NotificationSubject.py index 83bee7d3..9be34885 100644 --- a/github/NotificationSubject.py +++ b/github/NotificationSubject.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 AKFish # diff --git a/github/Organization.py b/github/Organization.py index fab8859a..3354a636 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Steve English # diff --git a/github/PaginatedList.py b/github/PaginatedList.py index 2b2227fb..8542e31d 100644 --- a/github/PaginatedList.py +++ b/github/PaginatedList.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # @@ -53,12 +51,10 @@ class PaginatedListBase: return self._Slice(self, index) def __iter__(self): - for element in self.__elements: - yield element + yield from self.__elements while self._couldGrow(): newElements = self._grow() - for element in newElements: - yield element + yield from newElements def _isBiggerThan(self, index): return len(self.__elements) > index or self._couldGrow() diff --git a/github/Path.py b/github/Path.py index 7b2102b8..89b9564a 100644 --- a/github/Path.py +++ b/github/Path.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Justin Kufro # diff --git a/github/Permissions.py b/github/Permissions.py index 95b13c85..bd62f0dc 100644 --- a/github/Permissions.py +++ b/github/Permissions.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/Plan.py b/github/Plan.py index 29d1fd7d..6bbbbfe3 100644 --- a/github/Plan.py +++ b/github/Plan.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/Project.py b/github/Project.py index 5312d287..9757f74f 100644 --- a/github/Project.py +++ b/github/Project.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 bbi-yggy # diff --git a/github/ProjectCard.py b/github/ProjectCard.py index 9e9109a9..97b8561c 100644 --- a/github/ProjectCard.py +++ b/github/ProjectCard.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 bbi-yggy # diff --git a/github/ProjectColumn.py b/github/ProjectColumn.py index 024632dd..21e312e2 100644 --- a/github/ProjectColumn.py +++ b/github/ProjectColumn.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 bbi-yggy # diff --git a/github/PullRequest.py b/github/PullRequest.py index 6ccd7dac..1306f304 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Michael Stead # diff --git a/github/PullRequestComment.py b/github/PullRequestComment.py index 8953c739..ae2b4b0e 100644 --- a/github/PullRequestComment.py +++ b/github/PullRequestComment.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/PullRequestMergeStatus.py b/github/PullRequestMergeStatus.py index add34390..3ec124e5 100644 --- a/github/PullRequestMergeStatus.py +++ b/github/PullRequestMergeStatus.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/PullRequestPart.py b/github/PullRequestPart.py index a069b2f1..94ab3f37 100644 --- a/github/PullRequestPart.py +++ b/github/PullRequestPart.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/PullRequestReview.py b/github/PullRequestReview.py index c0a93581..8b217c0d 100644 --- a/github/PullRequestReview.py +++ b/github/PullRequestReview.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2017 Aaron Levine # diff --git a/github/Rate.py b/github/Rate.py index a0813490..70b46769 100644 --- a/github/Rate.py +++ b/github/Rate.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/github/RateLimit.py b/github/RateLimit.py index 5335ad5e..b40c4780 100644 --- a/github/RateLimit.py +++ b/github/RateLimit.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/github/Reaction.py b/github/Reaction.py index 624ac8b7..59089a0a 100644 --- a/github/Reaction.py +++ b/github/Reaction.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2017 Nicolas Agustín Torres # diff --git a/github/Referrer.py b/github/Referrer.py index e2140764..7a0d03c6 100644 --- a/github/Referrer.py +++ b/github/Referrer.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Justin Kufro # diff --git a/github/Repository.py b/github/Repository.py index 94567bba..19f5e945 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Christopher Gilbert # diff --git a/github/RepositoryKey.py b/github/RepositoryKey.py index 11dba434..2ff72e14 100644 --- a/github/RepositoryKey.py +++ b/github/RepositoryKey.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/RepositoryPreferences.py b/github/RepositoryPreferences.py index 4c954ca3..467264e0 100644 --- a/github/RepositoryPreferences.py +++ b/github/RepositoryPreferences.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Dhruv Manilawala # diff --git a/github/Requester.py b/github/Requester.py index 24be1772..8842e3ed 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Andrew Bettison # @@ -81,7 +79,7 @@ class RequestsResponse: return self.text -class HTTPSRequestsConnectionClass(object): +class HTTPSRequestsConnectionClass: # mimic the httplib connection object def __init__( self, host, port=None, strict=False, timeout=None, retry=None, **kwargs @@ -106,7 +104,7 @@ class HTTPSRequestsConnectionClass(object): def getresponse(self): verb = getattr(self.session, self.verb.lower()) - url = "%s://%s:%s%s" % (self.protocol, self.host, self.port, self.url) + url = f"{self.protocol}://{self.host}:{self.port}{self.url}" r = verb( url, headers=self.headers, @@ -121,7 +119,7 @@ class HTTPSRequestsConnectionClass(object): return -class HTTPRequestsConnectionClass(object): +class HTTPRequestsConnectionClass: # mimic the httplib connection object def __init__( self, host, port=None, strict=False, timeout=None, retry=None, **kwargs @@ -146,7 +144,7 @@ class HTTPRequestsConnectionClass(object): def getresponse(self): verb = getattr(self.session, self.verb.lower()) - url = "%s://%s:%s%s" % (self.protocol, self.host, self.port, self.url) + url = f"{self.protocol}://{self.host}:{self.port}{self.url}" r = verb( url, headers=self.headers, @@ -513,7 +511,7 @@ class Requester: response = cnx.getresponse() status = response.status - responseHeaders = dict((k.lower(), v) for k, v in response.getheaders()) + responseHeaders = {k.lower(): v for k, v in response.getheaders()} output = response.read() cnx.close() diff --git a/github/RequiredPullRequestReviews.py b/github/RequiredPullRequestReviews.py index 34b8ce43..70ef469a 100644 --- a/github/RequiredPullRequestReviews.py +++ b/github/RequiredPullRequestReviews.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Steve Kowalik # diff --git a/github/RequiredStatusChecks.py b/github/RequiredStatusChecks.py index e4fba2e1..5dc0a460 100644 --- a/github/RequiredStatusChecks.py +++ b/github/RequiredStatusChecks.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Steve Kowalik # diff --git a/github/SelfHostedActionsRunner.py b/github/SelfHostedActionsRunner.py index 69a140ed..1d3a434d 100644 --- a/github/SelfHostedActionsRunner.py +++ b/github/SelfHostedActionsRunner.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Victor Zeng # diff --git a/github/SourceImport.py b/github/SourceImport.py index 2d43bafa..88c32af2 100644 --- a/github/SourceImport.py +++ b/github/SourceImport.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Hayden Fuss # diff --git a/github/Stargazer.py b/github/Stargazer.py index 71f51705..fa50b803 100644 --- a/github/Stargazer.py +++ b/github/Stargazer.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2015 Dan Vanderkam # diff --git a/github/StatsCodeFrequency.py b/github/StatsCodeFrequency.py index aab58812..eb950b3c 100755 --- a/github/StatsCodeFrequency.py +++ b/github/StatsCodeFrequency.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/github/StatsCommitActivity.py b/github/StatsCommitActivity.py index ade32342..712232a5 100755 --- a/github/StatsCommitActivity.py +++ b/github/StatsCommitActivity.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/github/StatsContributor.py b/github/StatsContributor.py index 3d800690..e8d16028 100755 --- a/github/StatsContributor.py +++ b/github/StatsContributor.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/github/StatsParticipation.py b/github/StatsParticipation.py index 546b7784..fc41c0f5 100755 --- a/github/StatsParticipation.py +++ b/github/StatsParticipation.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/github/StatsPunchCard.py b/github/StatsPunchCard.py index 4ad51dee..5aa30163 100755 --- a/github/StatsPunchCard.py +++ b/github/StatsPunchCard.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/github/Tag.py b/github/Tag.py index 65a601b2..591bab2b 100644 --- a/github/Tag.py +++ b/github/Tag.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/Team.py b/github/Team.py index 5fbb52e8..d2bac9d0 100644 --- a/github/Team.py +++ b/github/Team.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/TeamDiscussion.py b/github/TeamDiscussion.py index 207ebe4e..62f8c4f4 100644 --- a/github/TeamDiscussion.py +++ b/github/TeamDiscussion.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2019 Adam Baratz # diff --git a/github/TimelineEvent.py b/github/TimelineEvent.py index 57307731..2607da98 100644 --- a/github/TimelineEvent.py +++ b/github/TimelineEvent.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2019 Nick Campbell # diff --git a/github/TimelineEventSource.py b/github/TimelineEventSource.py index da2c0c01..cecaa09d 100644 --- a/github/TimelineEventSource.py +++ b/github/TimelineEventSource.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2019 Nick Campbell # diff --git a/github/Topic.py b/github/Topic.py index bb5aaffb..d58837ab 100644 --- a/github/Topic.py +++ b/github/Topic.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Steve Kowalik # diff --git a/github/UserKey.py b/github/UserKey.py index d8ff31b9..3ac1dde5 100644 --- a/github/UserKey.py +++ b/github/UserKey.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/github/View.py b/github/View.py index d0180543..5f643bcc 100644 --- a/github/View.py +++ b/github/View.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Justin Kufro # diff --git a/github/Workflow.py b/github/Workflow.py index bb3665ff..d5b7d448 100644 --- a/github/Workflow.py +++ b/github/Workflow.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Steve Kowalik # diff --git a/github/WorkflowRun.py b/github/WorkflowRun.py index 31338657..3631f6e2 100644 --- a/github/WorkflowRun.py +++ b/github/WorkflowRun.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Steve Kowalik # diff --git a/github/__init__.py b/github/__init__.py index d1ae8321..c978fbe9 100644 --- a/github/__init__.py +++ b/github/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/scripts/add_attribute.py b/scripts/add_attribute.py index e76cdc79..d8b29be2 100644 --- a/scripts/add_attribute.py +++ b/scripts/add_attribute.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # diff --git a/scripts/fix_headers.py b/scripts/fix_headers.py index d58dfc05..f7c0fccd 100755 --- a/scripts/fix_headers.py +++ b/scripts/fix_headers.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # diff --git a/setup.py b/setup.py index d0c8abd1..82366f23 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # diff --git a/tests/ApplicationOAuth.py b/tests/ApplicationOAuth.py index 408fd5ab..ce374d54 100644 --- a/tests/ApplicationOAuth.py +++ b/tests/ApplicationOAuth.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2019 Rigas Papathanasopoulos # @@ -37,14 +35,14 @@ class ApplicationOAuth(Framework.TestCase): sample_uri = "https://myapp.com/some/path" sample_uri_encoded = "https%3A%2F%2Fmyapp.com%2Fsome%2Fpath" self.assertEqual( - self.app.get_login_url(), "{}?client_id={}".format(BASE_URL, self.CLIENT_ID) + self.app.get_login_url(), f"{BASE_URL}?client_id={self.CLIENT_ID}" ) self.assertTrue( - "redirect_uri={}".format(sample_uri_encoded) + f"redirect_uri={sample_uri_encoded}" in self.app.get_login_url(redirect_uri=sample_uri) ) self.assertTrue( - "client_id={}".format(self.CLIENT_ID) + f"client_id={self.CLIENT_ID}" in self.app.get_login_url(redirect_uri=sample_uri) ) self.assertTrue( @@ -54,7 +52,7 @@ class ApplicationOAuth(Framework.TestCase): "login=user" in self.app.get_login_url(state="123abc", login="user") ) self.assertTrue( - "client_id={}".format(self.CLIENT_ID) + f"client_id={self.CLIENT_ID}" in self.app.get_login_url(state="123abc", login="user") ) diff --git a/tests/AuthenticatedUser.py b/tests/AuthenticatedUser.py index c7875799..79e10528 100644 --- a/tests/AuthenticatedUser.py +++ b/tests/AuthenticatedUser.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Authentication.py b/tests/Authentication.py index 20e13f86..dec6b9f3 100644 --- a/tests/Authentication.py +++ b/tests/Authentication.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Authorization.py b/tests/Authorization.py index a151c2df..2e05cb7d 100644 --- a/tests/Authorization.py +++ b/tests/Authorization.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/BadAttributes.py b/tests/BadAttributes.py index 7b48fe90..4aba0284 100755 --- a/tests/BadAttributes.py +++ b/tests/BadAttributes.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # @@ -117,149 +115,149 @@ class BadAttributes(Framework.TestCase): hooks, lambda h: h.name, [ - u"activecollab", - u"acunote", - u"agilebench", - u"agilezen", - u"amazonsns", - u"apiary", - u"apoio", - u"appharbor", - u"apropos", - u"asana", - u"backlog", - u"bamboo", - u"basecamp", - u"bcx", - u"blimp", - u"boxcar", - u"buddycloud", - u"bugherd", - u"bugly", - u"bugzilla", - u"campfire", - u"cia", - u"circleci", - u"codeclimate", - u"codeportingcsharp2java", - u"codeship", - u"coffeedocinfo", - u"conductor", - u"coop", - u"copperegg", - u"cube", - u"depending", - u"deployhq", - u"devaria", - u"docker", - u"ducksboard", - u"email", - u"firebase", - u"fisheye", - u"flowdock", - u"fogbugz", - u"freckle", - u"friendfeed", - u"gemini", - u"gemnasium", - u"geocommit", - u"getlocalization", - u"gitlive", - u"grmble", - u"grouptalent", - u"grove", - u"habitualist", - u"hakiri", - u"hall", - u"harvest", - u"hipchat", - u"hostedgraphite", - u"hubcap", - u"hubci", - u"humbug", - u"icescrum", - u"irc", - u"irker", - u"ironmq", - u"ironworker", - u"jabber", - u"jaconda", - u"jeapie", - u"jenkins", - u"jenkinsgit", - u"jira", - u"jqueryplugins", - u"kanbanery", - u"kickoff", - u"leanto", - u"lechat", - u"lighthouse", - u"lingohub", - u"loggly", - u"mantisbt", - u"masterbranch", - u"mqttpub", - u"nma", - u"nodejitsu", - u"notifo", - u"ontime", - u"pachube", - u"packagist", - u"phraseapp", - u"pivotaltracker", - u"planbox", - u"planio", - u"prowl", - u"puppetlinter", - u"pushalot", - u"pushover", - u"pythonpackages", - u"railsbp", - u"railsbrakeman", - u"rally", - u"rapidpush", - u"rationaljazzhub", - u"rationalteamconcert", - u"rdocinfo", - u"readthedocs", - u"redmine", - u"rubyforge", - u"scrumdo", - u"shiningpanda", - u"sifter", - u"simperium", - u"slatebox", - u"snowyevening", - u"socialcast", - u"softlayermessaging", - u"sourcemint", - u"splendidbacon", - u"sprintly", - u"sqsqueue", - u"stackmob", - u"statusnet", - u"talker", - u"targetprocess", - u"tddium", - u"teamcity", - u"tender", - u"tenxer", - u"testpilot", - u"toggl", - u"trac", - u"trajectory", - u"travis", - u"trello", - u"twilio", - u"twitter", - u"unfuddle", - u"web", - u"weblate", - u"webtranslateit", - u"yammer", - u"youtrack", - u"zendesk", - u"zohoprojects", + "activecollab", + "acunote", + "agilebench", + "agilezen", + "amazonsns", + "apiary", + "apoio", + "appharbor", + "apropos", + "asana", + "backlog", + "bamboo", + "basecamp", + "bcx", + "blimp", + "boxcar", + "buddycloud", + "bugherd", + "bugly", + "bugzilla", + "campfire", + "cia", + "circleci", + "codeclimate", + "codeportingcsharp2java", + "codeship", + "coffeedocinfo", + "conductor", + "coop", + "copperegg", + "cube", + "depending", + "deployhq", + "devaria", + "docker", + "ducksboard", + "email", + "firebase", + "fisheye", + "flowdock", + "fogbugz", + "freckle", + "friendfeed", + "gemini", + "gemnasium", + "geocommit", + "getlocalization", + "gitlive", + "grmble", + "grouptalent", + "grove", + "habitualist", + "hakiri", + "hall", + "harvest", + "hipchat", + "hostedgraphite", + "hubcap", + "hubci", + "humbug", + "icescrum", + "irc", + "irker", + "ironmq", + "ironworker", + "jabber", + "jaconda", + "jeapie", + "jenkins", + "jenkinsgit", + "jira", + "jqueryplugins", + "kanbanery", + "kickoff", + "leanto", + "lechat", + "lighthouse", + "lingohub", + "loggly", + "mantisbt", + "masterbranch", + "mqttpub", + "nma", + "nodejitsu", + "notifo", + "ontime", + "pachube", + "packagist", + "phraseapp", + "pivotaltracker", + "planbox", + "planio", + "prowl", + "puppetlinter", + "pushalot", + "pushover", + "pythonpackages", + "railsbp", + "railsbrakeman", + "rally", + "rapidpush", + "rationaljazzhub", + "rationalteamconcert", + "rdocinfo", + "readthedocs", + "redmine", + "rubyforge", + "scrumdo", + "shiningpanda", + "sifter", + "simperium", + "slatebox", + "snowyevening", + "socialcast", + "softlayermessaging", + "sourcemint", + "splendidbacon", + "sprintly", + "sqsqueue", + "stackmob", + "statusnet", + "talker", + "targetprocess", + "tddium", + "teamcity", + "tender", + "tenxer", + "testpilot", + "toggl", + "trac", + "trajectory", + "travis", + "trello", + "twilio", + "twitter", + "unfuddle", + "web", + "weblate", + "webtranslateit", + "yammer", + "youtrack", + "zendesk", + "zohoprojects", ], ) for hook in hooks: diff --git a/tests/Branch.py b/tests/Branch.py index c5ff5768..876d50fe 100644 --- a/tests/Branch.py +++ b/tests/Branch.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # @@ -87,10 +85,10 @@ class Branch(Framework.TestCase): self.assertEqual( raisedexp.exception.data, { - u"documentation_url": u"https://developer.github.com/v3/repos/branches/#update-branch-protection", - u"message": u"Validation Failed", - u"errors": [ - u"Only organization repositories can have users and team restrictions" + "documentation_url": "https://developer.github.com/v3/repos/branches/#update-branch-protection", + "message": "Validation Failed", + "errors": [ + "Only organization repositories can have users and team restrictions" ], }, ) @@ -104,10 +102,10 @@ class Branch(Framework.TestCase): self.assertEqual( raisedexp.exception.data, { - u"documentation_url": u"https://developer.github.com/v3/repos/branches/#update-branch-protection", - u"message": u"Validation Failed", - u"errors": [ - u"Only organization repositories can have users and team restrictions" + "documentation_url": "https://developer.github.com/v3/repos/branches/#update-branch-protection", + "message": "Validation Failed", + "errors": [ + "Only organization repositories can have users and team restrictions" ], }, ) @@ -147,8 +145,8 @@ class Branch(Framework.TestCase): self.assertEqual( raisedexp.exception.data, { - u"documentation_url": u"https://developer.github.com/v3/repos/branches/#get-branch-protection", - u"message": u"Branch not protected", + "documentation_url": "https://developer.github.com/v3/repos/branches/#get-branch-protection", + "message": "Branch not protected", }, ) @@ -166,8 +164,8 @@ class Branch(Framework.TestCase): self.assertEqual( raisedexp.exception.data, { - u"documentation_url": u"https://developer.github.com/v3/repos/branches/#get-required-status-checks-of-protected-branch", - u"message": u"Required status checks not enabled", + "documentation_url": "https://developer.github.com/v3/repos/branches/#get-required-status-checks-of-protected-branch", + "message": "Required status checks not enabled", }, ) @@ -193,8 +191,8 @@ class Branch(Framework.TestCase): self.assertEqual( raisedexp.exception.data, { - u"documentation_url": u"https://developer.github.com/v3/repos/branches/#update-pull-request-review-enforcement-of-protected-branch", - u"message": u"Invalid request.\n\n9 must be less than or equal to 6.", + "documentation_url": "https://developer.github.com/v3/repos/branches/#update-pull-request-review-enforcement-of-protected-branch", + "message": "Invalid request.\n\n9 must be less than or equal to 6.", }, ) @@ -207,8 +205,8 @@ class Branch(Framework.TestCase): self.assertEqual( raisedexp.exception.data, { - u"documentation_url": u"https://developer.github.com/v3/repos/branches/#update-pull-request-review-enforcement-of-protected-branch", - u"message": u"Dismissal restrictions are supported only for repositories owned by an organization.", + "documentation_url": "https://developer.github.com/v3/repos/branches/#update-pull-request-review-enforcement-of-protected-branch", + "message": "Dismissal restrictions are supported only for repositories owned by an organization.", }, ) @@ -295,8 +293,8 @@ class Branch(Framework.TestCase): self.assertEqual( raisedexp.exception.data, { - u"documentation_url": u"https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch", - u"message": u"Push restrictions not enabled", + "documentation_url": "https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch", + "message": "Push restrictions not enabled", }, ) diff --git a/tests/BranchProtection.py b/tests/BranchProtection.py index 43e46feb..65a75d21 100644 --- a/tests/BranchProtection.py +++ b/tests/BranchProtection.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Steve Kowalik # diff --git a/tests/CheckRun.py b/tests/CheckRun.py index 50b586fc..818371b5 100644 --- a/tests/CheckRun.py +++ b/tests/CheckRun.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Dhruv Manilawala # diff --git a/tests/CheckSuite.py b/tests/CheckSuite.py index 6b36d7bd..9dafaeb6 100644 --- a/tests/CheckSuite.py +++ b/tests/CheckSuite.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Raju Subramanian # diff --git a/tests/Commit.py b/tests/Commit.py index 779f4f23..beb3d488 100644 --- a/tests/Commit.py +++ b/tests/Commit.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/CommitCombinedStatus.py b/tests/CommitCombinedStatus.py index b524b06c..c51588e9 100644 --- a/tests/CommitCombinedStatus.py +++ b/tests/CommitCombinedStatus.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2016 Jannis Gebauer # diff --git a/tests/CommitComment.py b/tests/CommitComment.py index 1e38fe19..8f1a58fb 100644 --- a/tests/CommitComment.py +++ b/tests/CommitComment.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/CommitStatus.py b/tests/CommitStatus.py index b052b497..b94cf424 100644 --- a/tests/CommitStatus.py +++ b/tests/CommitStatus.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/ConditionalRequestUpdate.py b/tests/ConditionalRequestUpdate.py index 5fadc0b4..a29eefdc 100644 --- a/tests/ConditionalRequestUpdate.py +++ b/tests/ConditionalRequestUpdate.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 AKFish # diff --git a/tests/Connection.py b/tests/Connection.py index 6f7f878f..a0869d3e 100644 --- a/tests/Connection.py +++ b/tests/Connection.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2019 Adam Baratz # @@ -43,16 +41,16 @@ PARAMETERS = itertools.product( "\nGET\napi.github.com\nNone\n/user\n{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}\nNone\n200\n[]\n{\"body\":\"BODY TEXT\"}\n\n", ), ( - u'{"body":"BODY\xa0TEXT"}', - u"\nGET\napi.github.com\nNone\n/user\n{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}\nNone\n200\n[]\n{\"body\":\"BODY\xa0TEXT\"}\n\n", + '{"body":"BODY\xa0TEXT"}', + "\nGET\napi.github.com\nNone\n/user\n{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}\nNone\n200\n[]\n{\"body\":\"BODY\xa0TEXT\"}\n\n", ), ( "BODY TEXT", "\nGET\napi.github.com\nNone\n/user\n{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}\nNone\n200\n[]\nBODY TEXT\n\n", ), ( - u"BODY\xa0TEXT", - u"\nGET\napi.github.com\nNone\n/user\n{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}\nNone\n200\n[]\nBODY\xa0TEXT\n\n", + "BODY\xa0TEXT", + "\nGET\napi.github.com\nNone\n/user\n{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}\nNone\n200\n[]\nBODY\xa0TEXT\n\n", ), ], ) diff --git a/tests/ContentFile.py b/tests/ContentFile.py index 10725fc9..1b3c61fb 100644 --- a/tests/ContentFile.py +++ b/tests/ContentFile.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Deployment.py b/tests/Deployment.py index 73266aac..b0c2fbcb 100644 --- a/tests/Deployment.py +++ b/tests/Deployment.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Steve Kowalik # diff --git a/tests/DeploymentStatus.py b/tests/DeploymentStatus.py index f15ecd68..0b4a2266 100644 --- a/tests/DeploymentStatus.py +++ b/tests/DeploymentStatus.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Colby Gallup # diff --git a/tests/Download.py b/tests/Download.py index 3ae521c6..d1c3e752 100644 --- a/tests/Download.py +++ b/tests/Download.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Enterprise.py b/tests/Enterprise.py index 772eb88a..b0a5ee4d 100644 --- a/tests/Enterprise.py +++ b/tests/Enterprise.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Equality.py b/tests/Equality.py index b0cc3644..ed2d01b7 100755 --- a/tests/Equality.py +++ b/tests/Equality.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/tests/Event.py b/tests/Event.py index 8b58f3c5..1be98f42 100644 --- a/tests/Event.py +++ b/tests/Event.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Exceptions.py b/tests/Exceptions.py index 4d94fc10..6b9edc5e 100644 --- a/tests/Exceptions.py +++ b/tests/Exceptions.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/ExposeAllAttributes.py b/tests/ExposeAllAttributes.py index 161b617f..6a8022b5 100644 --- a/tests/ExposeAllAttributes.py +++ b/tests/ExposeAllAttributes.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/tests/Framework.py b/tests/Framework.py index d0420c72..fce12927 100644 --- a/tests/Framework.py +++ b/tests/Framework.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # @@ -132,7 +130,7 @@ class RecordingConnection: return self.__cnx.close() def __writeLine(self, line): - self.__file.write(str(line) + u"\n") + self.__file.write(str(line) + "\n") class RecordingHttpConnection(RecordingConnection): @@ -314,7 +312,7 @@ class BasicTestCase(unittest.TestCase): if fileName != self.__fileName: self.__closeReplayFileIfNeeded() self.__fileName = fileName - self.__file = io.open(self.__fileName, mode, encoding="utf-8") + self.__file = open(self.__fileName, mode, encoding="utf-8") return self.__file def __closeReplayFileIfNeeded(self): diff --git a/tests/Gist.py b/tests/Gist.py index 693d2223..a2127d3a 100644 --- a/tests/Gist.py +++ b/tests/Gist.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/GistComment.py b/tests/GistComment.py index 6d747e3e..0853fc2f 100644 --- a/tests/GistComment.py +++ b/tests/GistComment.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/GitBlob.py b/tests/GitBlob.py index fcd9aa8c..881378fa 100644 --- a/tests/GitBlob.py +++ b/tests/GitBlob.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/GitCommit.py b/tests/GitCommit.py index 9254ac8b..66564537 100644 --- a/tests/GitCommit.py +++ b/tests/GitCommit.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/GitMembership.py b/tests/GitMembership.py index 1dafae3b..acb8e7cd 100644 --- a/tests/GitMembership.py +++ b/tests/GitMembership.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Steve English # diff --git a/tests/GitRef.py b/tests/GitRef.py index 4d34eed7..726d9cab 100644 --- a/tests/GitRef.py +++ b/tests/GitRef.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/GitRelease.py b/tests/GitRelease.py index d0af282f..6e4cc5a8 100644 --- a/tests/GitRelease.py +++ b/tests/GitRelease.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2015 Ed Holland # @@ -141,7 +139,7 @@ class GitRelease(Framework.TestCase): self.assertEqual(release.author.type, "User") self.assertEqual( release.html_url, - "https://github.com/{}/{}/releases/tag/{}".format(user, repo_name, tag), + f"https://github.com/{user}/{repo_name}/releases/tag/{tag}", ) self.assertEqual(release.created_at, create_date) self.assertEqual(release.published_at, publish_date) diff --git a/tests/GitTag.py b/tests/GitTag.py index 2e44e91b..d827282f 100644 --- a/tests/GitTag.py +++ b/tests/GitTag.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/GitTree.py b/tests/GitTree.py index b39bcb4b..69718f2e 100644 --- a/tests/GitTree.py +++ b/tests/GitTree.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/GithubApp.py b/tests/GithubApp.py index 4eb88653..63ea3209 100644 --- a/tests/GithubApp.py +++ b/tests/GithubApp.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Raju Subramanian # diff --git a/tests/GithubIntegration.py b/tests/GithubIntegration.py index 3d941d1d..272f50db 100644 --- a/tests/GithubIntegration.py +++ b/tests/GithubIntegration.py @@ -51,7 +51,7 @@ class GithubIntegration(unittest.TestCase): self.origin_time = sys.modules["time"].time sys.modules["time"].time = lambda: 1550055331.7435968 - class Mock(object): + class Mock: def __init__(self): self.args = tuple() self.kwargs = dict() @@ -66,8 +66,8 @@ class GithubIntegration(unittest.TestCase): @property def text(self): return ( - u'{"token": "v1.ce63424bc55028318325caac4f4c3a5378ca0038",' - u'"expires_at": "2019-02-13T11:10:38Z"}' + '{"token": "v1.ce63424bc55028318325caac4f4c3a5378ca0038",' + '"expires_at": "2019-02-13T11:10:38Z"}' ) def __call__(self, *args, **kwargs): @@ -79,7 +79,7 @@ class GithubIntegration(unittest.TestCase): self.mock = Mock() sys.modules["requests"].post = self.mock - class GetMock(object): + class GetMock: def __init__(self): self.args = tuple() self.kwargs = dict() @@ -95,28 +95,28 @@ class GithubIntegration(unittest.TestCase): @property def text(self): return ( - u'{"id":111111,"account":{"login":"foo","id":11111111,' - u'"node_id":"foobar",' - u'"avatar_url":"https://avatars3.githubusercontent.com/u/11111111?v=4",' - u'"gravatar_id":"","url":"https://api.github.com/users/foo",' - u'"html_url":"https://github.com/foo",' - u'"followers_url":"https://api.github.com/users/foo/followers",' - u'"following_url":"https://api.github.com/users/foo/following{/other_user}",' - u'"gists_url":"https://api.github.com/users/foo/gists{/gist_id}",' - u'"starred_url":"https://api.github.com/users/foo/starred{/owner}{/repo}",' - u'"subscriptions_url":"https://api.github.com/users/foo/subscriptions",' - u'"organizations_url":"https://api.github.com/users/foo/orgs",' - u'"repos_url":"https://api.github.com/users/foo/repos",' - u'"events_url":"https://api.github.com/users/foo/events{/privacy}",' - u'"received_events_url":"https://api.github.com/users/foo/received_events",' - u'"type":"Organization","site_admin":false},"repository_selection":"all",' - u'"access_tokens_url":"https://api.github.com/app/installations/111111/access_tokens",' - u'"repositories_url":"https://api.github.com/installation/repositories",' - u'"html_url":"https://github.com/organizations/foo/settings/installations/111111",' - u'"app_id":11111,"target_id":11111111,"target_type":"Organization",' - u'"permissions":{"issues":"write","pull_requests":"write","statuses":"write","contents":"read",' - u'"metadata":"read"},"events":["pull_request","release"],"created_at":"2019-04-17T16:10:37.000Z",' - u'"updated_at":"2019-05-03T06:27:48.000Z","single_file_name":null}' + '{"id":111111,"account":{"login":"foo","id":11111111,' + '"node_id":"foobar",' + '"avatar_url":"https://avatars3.githubusercontent.com/u/11111111?v=4",' + '"gravatar_id":"","url":"https://api.github.com/users/foo",' + '"html_url":"https://github.com/foo",' + '"followers_url":"https://api.github.com/users/foo/followers",' + '"following_url":"https://api.github.com/users/foo/following{/other_user}",' + '"gists_url":"https://api.github.com/users/foo/gists{/gist_id}",' + '"starred_url":"https://api.github.com/users/foo/starred{/owner}{/repo}",' + '"subscriptions_url":"https://api.github.com/users/foo/subscriptions",' + '"organizations_url":"https://api.github.com/users/foo/orgs",' + '"repos_url":"https://api.github.com/users/foo/repos",' + '"events_url":"https://api.github.com/users/foo/events{/privacy}",' + '"received_events_url":"https://api.github.com/users/foo/received_events",' + '"type":"Organization","site_admin":false},"repository_selection":"all",' + '"access_tokens_url":"https://api.github.com/app/installations/111111/access_tokens",' + '"repositories_url":"https://api.github.com/installation/repositories",' + '"html_url":"https://github.com/organizations/foo/settings/installations/111111",' + '"app_id":11111,"target_id":11111111,"target_type":"Organization",' + '"permissions":{"issues":"write","pull_requests":"write","statuses":"write","contents":"read",' + '"metadata":"read"},"events":["pull_request","release"],"created_at":"2019-04-17T16:10:37.000Z",' + '"updated_at":"2019-05-03T06:27:48.000Z","single_file_name":null}' ) def __call__(self, *args, **kwargs): diff --git a/tests/Github_.py b/tests/Github_.py index 8b4a6de4..3e702751 100644 --- a/tests/Github_.py +++ b/tests/Github_.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Hook.py b/tests/Hook.py index 4cb05746..86c0257a 100644 --- a/tests/Hook.py +++ b/tests/Hook.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Issue.py b/tests/Issue.py index 030b54e6..bb2014b3 100644 --- a/tests/Issue.py +++ b/tests/Issue.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Issue131.py b/tests/Issue131.py index 6554b86f..6a4046aa 100644 --- a/tests/Issue131.py +++ b/tests/Issue131.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/tests/Issue133.py b/tests/Issue133.py index ee584073..78a24452 100644 --- a/tests/Issue133.py +++ b/tests/Issue133.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/tests/Issue134.py b/tests/Issue134.py index 9f10cc98..13d971c2 100644 --- a/tests/Issue134.py +++ b/tests/Issue134.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/tests/Issue139.py b/tests/Issue139.py index a0f3455e..bcc44da7 100644 --- a/tests/Issue139.py +++ b/tests/Issue139.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/tests/Issue140.py b/tests/Issue140.py index e8afc37c..e5433f43 100644 --- a/tests/Issue140.py +++ b/tests/Issue140.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/tests/Issue142.py b/tests/Issue142.py index 2278bdfc..4f5f8fb2 100644 --- a/tests/Issue142.py +++ b/tests/Issue142.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/tests/Issue158.py b/tests/Issue158.py index c2e967b1..dfe55a44 100644 --- a/tests/Issue158.py +++ b/tests/Issue158.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/tests/Issue174.py b/tests/Issue174.py index 440f0254..11b57c99 100644 --- a/tests/Issue174.py +++ b/tests/Issue174.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/tests/Issue214.py b/tests/Issue214.py index 8483c372..9aea863e 100644 --- a/tests/Issue214.py +++ b/tests/Issue214.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 David Farr # diff --git a/tests/Issue216.py b/tests/Issue216.py index f7afedb8..98846716 100644 --- a/tests/Issue216.py +++ b/tests/Issue216.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/tests/Issue278.py b/tests/Issue278.py index d0ed142f..6b46c2c7 100644 --- a/tests/Issue278.py +++ b/tests/Issue278.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2014 Vincent Jacques # diff --git a/tests/Issue33.py b/tests/Issue33.py index 699abb43..a260fe52 100644 --- a/tests/Issue33.py +++ b/tests/Issue33.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Issue494.py b/tests/Issue494.py index 62a88043..10535107 100644 --- a/tests/Issue494.py +++ b/tests/Issue494.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2016 Sam Corbett # @@ -34,7 +32,7 @@ class Issue494(Framework.TestCase): def testRepr(self): expected = ( - u'PullRequest(title="Change SetHostnameCustomizer to check if ' - u'/etc/sysconfig/network exist…", number=465)' + 'PullRequest(title="Change SetHostnameCustomizer to check if ' + '/etc/sysconfig/network exist…", number=465)' ) self.assertEqual(self.pull.__repr__(), expected) diff --git a/tests/Issue50.py b/tests/Issue50.py index f4465248..81c7dd6f 100644 --- a/tests/Issue50.py +++ b/tests/Issue50.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Issue54.py b/tests/Issue54.py index 640e7927..d93ca051 100644 --- a/tests/Issue54.py +++ b/tests/Issue54.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Issue572.py b/tests/Issue572.py index 1738eaa7..f30a738c 100644 --- a/tests/Issue572.py +++ b/tests/Issue572.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Shinichi TAMURA # diff --git a/tests/Issue80.py b/tests/Issue80.py index 855f2250..11fcd49f 100644 --- a/tests/Issue80.py +++ b/tests/Issue80.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Issue823.py b/tests/Issue823.py index 23f6cd87..5f31412b 100644 --- a/tests/Issue823.py +++ b/tests/Issue823.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/tests/Issue87.py b/tests/Issue87.py index 311f82e8..d78e755d 100644 --- a/tests/Issue87.py +++ b/tests/Issue87.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Issue937.py b/tests/Issue937.py index 5574e936..a08e0c9d 100644 --- a/tests/Issue937.py +++ b/tests/Issue937.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Vinay Hegde # diff --git a/tests/Issue945.py b/tests/Issue945.py index f63cdf1c..59f812b6 100644 --- a/tests/Issue945.py +++ b/tests/Issue945.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Kelvin Wong (https://github.com/netsgnut) # diff --git a/tests/IssueComment.py b/tests/IssueComment.py index 5d052f08..f517a712 100644 --- a/tests/IssueComment.py +++ b/tests/IssueComment.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/IssueEvent.py b/tests/IssueEvent.py index 8e082777..837d7bb0 100644 --- a/tests/IssueEvent.py +++ b/tests/IssueEvent.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # @@ -420,8 +418,8 @@ class IssueEvent(Framework.TestCase): self.assertEqual( self.event_renamed.rename, { - u"to": u"Adding new attributes to IssueEvent", - u"from": u"Adding new attributes to IssueEvent Object (DO NOT MERGE - SEE NOTES)", + "to": "Adding new attributes to IssueEvent", + "from": "Adding new attributes to IssueEvent Object (DO NOT MERGE - SEE NOTES)", }, ) self.assertEqual(self.event_renamed.dismissed_review, None) @@ -663,9 +661,9 @@ class IssueEvent(Framework.TestCase): self.assertEqual( self.event_review_dismissed.dismissed_review, { - u"dismissal_message": u"dismiss", - u"state": u"changes_requested", - u"review_id": 145431295, + "dismissal_message": "dismiss", + "state": "changes_requested", + "review_id": 145431295, }, ) self.assertEqual(self.event_review_dismissed.lock_reason, None) diff --git a/tests/Label.py b/tests/Label.py index 4f45c8c6..10065544 100644 --- a/tests/Label.py +++ b/tests/Label.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/License.py b/tests/License.py index 2e9db671..57a956c6 100644 --- a/tests/License.py +++ b/tests/License.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Wan Liuyang # diff --git a/tests/Logging_.py b/tests/Logging_.py index 793263cd..3f277f61 100644 --- a/tests/Logging_.py +++ b/tests/Logging_.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # @@ -62,7 +60,7 @@ class Logging(Framework.BasicTestCase): output, ): self.verb = verb - self.url = "%s://%s%s" % (scheme, hostname, fragment) + self.url = f"{scheme}://{hostname}{fragment}" self.requestHeaders = requestHeaders self.input = input_ self.status = status diff --git a/tests/Markdown.py b/tests/Markdown.py index 3ae047fe..bc19651f 100644 --- a/tests/Markdown.py +++ b/tests/Markdown.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Migration.py b/tests/Migration.py index e4121e27..f503a6d2 100644 --- a/tests/Migration.py +++ b/tests/Migration.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Milestone.py b/tests/Milestone.py index 1c10eea9..82da2689 100644 --- a/tests/Milestone.py +++ b/tests/Milestone.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/NamedUser.py b/tests/NamedUser.py index 3f12e602..42dba7bc 100644 --- a/tests/NamedUser.py +++ b/tests/NamedUser.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/NamedUser1430.py b/tests/NamedUser1430.py index a265d9df..bd7804dc 100644 --- a/tests/NamedUser1430.py +++ b/tests/NamedUser1430.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Anuj Bansal # diff --git a/tests/Notification.py b/tests/Notification.py index ebbae5e6..44f937f2 100644 --- a/tests/Notification.py +++ b/tests/Notification.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Organization.py b/tests/Organization.py index ef5677d5..de59a523 100644 --- a/tests/Organization.py +++ b/tests/Organization.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # @@ -389,8 +387,8 @@ class Organization(Framework.TestCase): self.assertEqual( raisedexp.exception.data, { - u"documentation_url": u"https://developer.github.com/v3/orgs/members/#create-organization-invitation", - u"message": u"You must be an admin to create an invitation to an organization.", + "documentation_url": "https://developer.github.com/v3/orgs/members/#create-organization-invitation", + "message": "You must be an admin to create an invitation to an organization.", }, ) diff --git a/tests/Organization1437.py b/tests/Organization1437.py index d475b949..55bea243 100644 --- a/tests/Organization1437.py +++ b/tests/Organization1437.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Anuj Bansal # diff --git a/tests/OrganizationHasInMembers.py b/tests/OrganizationHasInMembers.py index 3e053c66..5977198f 100644 --- a/tests/OrganizationHasInMembers.py +++ b/tests/OrganizationHasInMembers.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2016 Matthew Neal # diff --git a/tests/PaginatedList.py b/tests/PaginatedList.py index b51c5067..ae06e902 100644 --- a/tests/PaginatedList.py +++ b/tests/PaginatedList.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Persistence.py b/tests/Persistence.py index d4baaa77..e5e45ae3 100644 --- a/tests/Persistence.py +++ b/tests/Persistence.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/tests/Project.py b/tests/Project.py index fcc64dc7..489e0846 100644 --- a/tests/Project.py +++ b/tests/Project.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - # ########################## Copyrights and license ############################ # # # Copyright 2018 bbi-yggy # diff --git a/tests/Project1434.py b/tests/Project1434.py index 4c973f84..63ba64e1 100644 --- a/tests/Project1434.py +++ b/tests/Project1434.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - # ########################## Copyrights and license ############################ # # # Copyright 2020 Anuj Bansal # diff --git a/tests/ProjectColumn.py b/tests/ProjectColumn.py index f824f6d7..7df02fa5 100644 --- a/tests/ProjectColumn.py +++ b/tests/ProjectColumn.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - # ########################## Copyrights and license ############################ # # # This file is part of PyGithub. # diff --git a/tests/PullRequest.py b/tests/PullRequest.py index 6a4e1823..a52dd3ca 100644 --- a/tests/PullRequest.py +++ b/tests/PullRequest.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/PullRequest1168.py b/tests/PullRequest1168.py index cf57b245..35705005 100644 --- a/tests/PullRequest1168.py +++ b/tests/PullRequest1168.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2019 Olof-Joachim Frahm # diff --git a/tests/PullRequest1169.py b/tests/PullRequest1169.py index 0cee1155..dd7730d3 100644 --- a/tests/PullRequest1169.py +++ b/tests/PullRequest1169.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2019 Olof-Joachim Frahm # diff --git a/tests/PullRequest1375.py b/tests/PullRequest1375.py index c0c77c10..21a69836 100644 --- a/tests/PullRequest1375.py +++ b/tests/PullRequest1375.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2019 Olof-Joachim Frahm # diff --git a/tests/PullRequest1682.py b/tests/PullRequest1682.py index 2e5a162d..29006b8c 100644 --- a/tests/PullRequest1682.py +++ b/tests/PullRequest1682.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Victor Zeng # diff --git a/tests/PullRequestComment.py b/tests/PullRequestComment.py index 3dcb7ece..2c9bb454 100644 --- a/tests/PullRequestComment.py +++ b/tests/PullRequestComment.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/PullRequestFile.py b/tests/PullRequestFile.py index bfafd478..025af8db 100644 --- a/tests/PullRequestFile.py +++ b/tests/PullRequestFile.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/PullRequestReview.py b/tests/PullRequestReview.py index bfda0634..a2e317cc 100644 --- a/tests/PullRequestReview.py +++ b/tests/PullRequestReview.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2017 Aaron Levine # diff --git a/tests/RateLimiting.py b/tests/RateLimiting.py index 63bf5a64..d8bd7a3b 100644 --- a/tests/RateLimiting.py +++ b/tests/RateLimiting.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/RawData.py b/tests/RawData.py index 18a2c753..963231b1 100644 --- a/tests/RawData.py +++ b/tests/RawData.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques # diff --git a/tests/Reaction.py b/tests/Reaction.py index 16969e7d..a9aa619a 100644 --- a/tests/Reaction.py +++ b/tests/Reaction.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2017 Nicolas Agustín Torres # diff --git a/tests/ReleaseAsset.py b/tests/ReleaseAsset.py index d3289bfb..d0b8af38 100644 --- a/tests/ReleaseAsset.py +++ b/tests/ReleaseAsset.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2017 Chris McBride # diff --git a/tests/Repository.py b/tests/Repository.py index eca4b1a8..88e6aa8d 100644 --- a/tests/Repository.py +++ b/tests/Repository.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # @@ -473,8 +471,8 @@ class Repository(Framework.TestCase): self.assertEqual( raisedexp.exception.data, { - u"documentation_url": u"https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level", - u"message": u"Must have push access to view collaborator permission.", + "documentation_url": "https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level", + "message": "Must have push access to view collaborator permission.", }, ) @@ -1094,12 +1092,12 @@ class Repository(Framework.TestCase): stargazers, lambda stargazer: (stargazer.starred_at, stargazer.user.login), [ - (datetime.datetime(2014, 8, 13, 19, 22, 5), u"sAlexander"), - (datetime.datetime(2014, 10, 15, 5, 2, 30), u"ThomasG77"), - (datetime.datetime(2015, 4, 14, 15, 22, 40), u"therusek"), - (datetime.datetime(2015, 4, 29, 0, 9, 40), u"athomann"), - (datetime.datetime(2015, 4, 29, 14, 26, 46), u"jcapron"), - (datetime.datetime(2015, 5, 9, 19, 14, 45), u"JoePython1"), + (datetime.datetime(2014, 8, 13, 19, 22, 5), "sAlexander"), + (datetime.datetime(2014, 10, 15, 5, 2, 30), "ThomasG77"), + (datetime.datetime(2015, 4, 14, 15, 22, 40), "therusek"), + (datetime.datetime(2015, 4, 29, 0, 9, 40), "athomann"), + (datetime.datetime(2015, 4, 29, 14, 26, 46), "jcapron"), + (datetime.datetime(2015, 5, 9, 19, 14, 45), "JoePython1"), ], ) self.assertEqual(repr(stargazers[0]), 'Stargazer(user="sAlexander")') @@ -1248,7 +1246,7 @@ class Repository(Framework.TestCase): def testCreateFile(self): newFile = "doc/testCreateUpdateDeleteFile.md" - content = "Hello world".encode() + content = b"Hello world" author = github.InputGitAuthor( "Enix Yu", "enix223@163.com", "2016-01-15T16:13:30+12:00" ) @@ -1666,7 +1664,7 @@ class Repository(Framework.TestCase): def testGetTopics(self): topic_list = self.repo.get_topics() - topic = u"github" + topic = "github" self.assertIn(topic, topic_list) def testReplaceTopics(self): @@ -1691,7 +1689,7 @@ class LazyRepository(Framework.TestCase): def setUp(self): super().setUp() self.user = self.g.get_user() - self.repository_name = "%s/%s" % (self.user.login, "PyGithub") + self.repository_name = "{}/{}".format(self.user.login, "PyGithub") def getLazyRepository(self): return self.g.get_repo(self.repository_name, lazy=True) diff --git a/tests/RepositoryKey.py b/tests/RepositoryKey.py index 12a784fe..4e290ab5 100644 --- a/tests/RepositoryKey.py +++ b/tests/RepositoryKey.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/RequiredPullRequestReviews.py b/tests/RequiredPullRequestReviews.py index dbf5e945..f1c3d2d0 100644 --- a/tests/RequiredPullRequestReviews.py +++ b/tests/RequiredPullRequestReviews.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Steve Kowalik # diff --git a/tests/RequiredStatusChecks.py b/tests/RequiredStatusChecks.py index 83f5e32d..882c57c5 100644 --- a/tests/RequiredStatusChecks.py +++ b/tests/RequiredStatusChecks.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Steve Kowalik # diff --git a/tests/Retry.py b/tests/Retry.py index 87034e2f..940d4058 100644 --- a/tests/Retry.py +++ b/tests/Retry.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Justin Kufro # diff --git a/tests/Search.py b/tests/Search.py index a7cea2d8..f7e2ffe1 100644 --- a/tests/Search.py +++ b/tests/Search.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2014 Vincent Jacques # @@ -43,41 +41,41 @@ class Search(Framework.TestCase): users, lambda u: u.login, [ - u"cloudhead", - u"felixge", - u"sferik", - u"rkh", - u"jezdez", - u"janl", - u"marijnh", - u"nikic", - u"igorw", - u"froschi", - u"svenfuchs", - u"omz", - u"chad", - u"bergie", - u"roidrage", - u"pcalcado", - u"durran", - u"hukl", - u"mttkay", - u"aFarkas", - u"ole", - u"hagenburger", - u"jberkel", - u"naderman", - u"joshk", - u"pudo", - u"robb", - u"josephwilk", - u"hanshuebner", - u"txus", - u"paulasmuth", - u"splitbrain", - u"langalex", - u"bendiken", - u"stefanw", + "cloudhead", + "felixge", + "sferik", + "rkh", + "jezdez", + "janl", + "marijnh", + "nikic", + "igorw", + "froschi", + "svenfuchs", + "omz", + "chad", + "bergie", + "roidrage", + "pcalcado", + "durran", + "hukl", + "mttkay", + "aFarkas", + "ole", + "hagenburger", + "jberkel", + "naderman", + "joshk", + "pudo", + "robb", + "josephwilk", + "hanshuebner", + "txus", + "paulasmuth", + "splitbrain", + "langalex", + "bendiken", + "stefanw", ], ) self.assertEqual(users.totalCount, 6038) @@ -87,36 +85,36 @@ class Search(Framework.TestCase): self.assertEqual( [u.login for u in users.get_page(7)], [ - u"ursachec", - u"bitboxer", - u"fs111", - u"michenriksen", - u"witsch", - u"booo", - u"mortice", - u"r0man", - u"MikeBild", - u"mhagger", - u"bkw", - u"fwbrasil", - u"mschneider", - u"lydiapintscher", - u"asksven", - u"iamtimm", - u"sneak", - u"kr1sp1n", - u"Feh", - u"GordonLesti", - u"annismckenzie", - u"eskimoblood", - u"tsujigiri", - u"riethmayer", - u"lauritzthamsen", - u"scotchi", - u"peritor", - u"toto", - u"hwaxxer", - u"lukaszklis", + "ursachec", + "bitboxer", + "fs111", + "michenriksen", + "witsch", + "booo", + "mortice", + "r0man", + "MikeBild", + "mhagger", + "bkw", + "fwbrasil", + "mschneider", + "lydiapintscher", + "asksven", + "iamtimm", + "sneak", + "kr1sp1n", + "Feh", + "GordonLesti", + "annismckenzie", + "eskimoblood", + "tsujigiri", + "riethmayer", + "lauritzthamsen", + "scotchi", + "peritor", + "toto", + "hwaxxer", + "lukaszklis", ], ) @@ -128,41 +126,41 @@ class Search(Framework.TestCase): repos, lambda r: r.full_name, [ - u"kennethreitz/legit", - u"RuudBurger/CouchPotatoV1", - u"gelstudios/gitfiti", - u"gpjt/webgl-lessons", - u"jacquev6/PyGithub", - u"aaasen/github_globe", - u"hmason/gitmarks", - u"dnerdy/factory_boy", - u"binaryage/drydrop", - u"bgreenlee/sublime-github", - u"karan/HackerNewsAPI", - u"mfenniak/pyPdf", - u"skazhy/github-decorator", - u"llvmpy/llvmpy", - u"lexrupy/gmate", - u"ask/python-github2", - u"audreyr/cookiecutter-pypackage", - u"tabo/django-treebeard", - u"dbr/tvdb_api", - u"jchris/couchapp", - u"joeyespo/grip", - u"nigelsmall/py2neo", - u"ask/chishop", - u"sigmavirus24/github3.py", - u"jsmits/github-cli", - u"lincolnloop/django-layout", - u"amccloud/django-project-skel", - u"Stiivi/brewery", - u"webpy/webpy.github.com", - u"dustin/py-github", - u"logsol/Github-Auto-Deploy", - u"cloudkick/libcloud", - u"berkerpeksag/github-badge", - u"bitprophet/ssh", - u"azavea/OpenTreeMap", + "kennethreitz/legit", + "RuudBurger/CouchPotatoV1", + "gelstudios/gitfiti", + "gpjt/webgl-lessons", + "jacquev6/PyGithub", + "aaasen/github_globe", + "hmason/gitmarks", + "dnerdy/factory_boy", + "binaryage/drydrop", + "bgreenlee/sublime-github", + "karan/HackerNewsAPI", + "mfenniak/pyPdf", + "skazhy/github-decorator", + "llvmpy/llvmpy", + "lexrupy/gmate", + "ask/python-github2", + "audreyr/cookiecutter-pypackage", + "tabo/django-treebeard", + "dbr/tvdb_api", + "jchris/couchapp", + "joeyespo/grip", + "nigelsmall/py2neo", + "ask/chishop", + "sigmavirus24/github3.py", + "jsmits/github-cli", + "lincolnloop/django-layout", + "amccloud/django-project-skel", + "Stiivi/brewery", + "webpy/webpy.github.com", + "dustin/py-github", + "logsol/Github-Auto-Deploy", + "cloudkick/libcloud", + "berkerpeksag/github-badge", + "bitprophet/ssh", + "azavea/OpenTreeMap", ], ) @@ -202,7 +200,7 @@ class Search(Framework.TestCase): self.assertListKeyBegin( topics, lambda r: r.name, - [u"python", u"django", u"flask", u"ruby", u"scikit-learn", u"wagtail"], + ["python", "django", "flask", "ruby", "scikit-learn", "wagtail"], ) def testPaginateSearchTopics(self): @@ -215,20 +213,20 @@ class Search(Framework.TestCase): files, lambda f: f.name, [ - u"Commit.setUp.txt", - u"PullRequest.testGetFiles.txt", - u"NamedUser.testGetEvents.txt", - u"PullRequest.testCreateComment.txt", - u"PullRequestFile.setUp.txt", - u"Repository.testGetIssuesWithWildcards.txt", - u"Repository.testGetIssuesWithArguments.txt", - u"test_ebnf.cpp", - u"test_abnf.cpp", - u"PullRequestFile.py", - u"SystemCalls.py", - u"tests.py", - u"LexerTestCase.py", - u"ParserTestCase.py", + "Commit.setUp.txt", + "PullRequest.testGetFiles.txt", + "NamedUser.testGetEvents.txt", + "PullRequest.testCreateComment.txt", + "PullRequestFile.setUp.txt", + "Repository.testGetIssuesWithWildcards.txt", + "Repository.testGetIssuesWithArguments.txt", + "test_ebnf.cpp", + "test_abnf.cpp", + "PullRequestFile.py", + "SystemCalls.py", + "tests.py", + "LexerTestCase.py", + "ParserTestCase.py", ], ) self.assertEqual(files[0].repository.full_name, "jacquev6/PyGithub") diff --git a/tests/SelfHostedActionsRunner.py b/tests/SelfHostedActionsRunner.py index 6264db59..f464d8c7 100644 --- a/tests/SelfHostedActionsRunner.py +++ b/tests/SelfHostedActionsRunner.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Victor Zeng # diff --git a/tests/SourceImport.py b/tests/SourceImport.py index db7aaea1..4d97ac97 100644 --- a/tests/SourceImport.py +++ b/tests/SourceImport.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Hayden Fuss # diff --git a/tests/Tag.py b/tests/Tag.py index fcefbe58..270e2d88 100644 --- a/tests/Tag.py +++ b/tests/Tag.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Team.py b/tests/Team.py index 01868387..c2d9d46b 100644 --- a/tests/Team.py +++ b/tests/Team.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Topic.py b/tests/Topic.py index f4c4869f..8bdfeaaf 100644 --- a/tests/Topic.py +++ b/tests/Topic.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2019 Adam Baratz # @@ -55,7 +53,7 @@ class Topic(Framework.TestCase): self.assertEqual(topic.curated, True) self.assertEqual(topic.score, 7576.306) - self.assertEqual(topic.__repr__(), u'Topic(name="python")') + self.assertEqual(topic.__repr__(), 'Topic(name="python")') def testNamesFromSearchResults(self): expected_names = [ diff --git a/tests/Traffic.py b/tests/Traffic.py index 9c7180ca..7dfe6dcc 100644 --- a/tests/Traffic.py +++ b/tests/Traffic.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2018 Justin Kufro # diff --git a/tests/UserKey.py b/tests/UserKey.py index cce0e00c..36cf3d18 100644 --- a/tests/UserKey.py +++ b/tests/UserKey.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/Workflow.py b/tests/Workflow.py index ac8a37a4..4f8ead19 100644 --- a/tests/Workflow.py +++ b/tests/Workflow.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Steve Kowalik # diff --git a/tests/WorkflowRun.py b/tests/WorkflowRun.py index 75c11f8c..02054bd7 100644 --- a/tests/WorkflowRun.py +++ b/tests/WorkflowRun.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Steve Kowalik # diff --git a/tests/__init__.py b/tests/__init__.py index 3558f3ea..6b87e361 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # diff --git a/tests/conftest.py b/tests/conftest.py index 88082e66..2d5c77f3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ############################ Copyrights and license ############################ # # # Copyright 2020 Steve Kowalik #