Clean up a lot of pyflakes warnings (#1153)

Clean up unused imports or unused variables to mostly silence pyflakes.
We aren't quite yet in a place where we can run it via Travis, but baby
steps.
This commit is contained in:
Steve Kowalik
2019-07-02 18:06:09 +10:00
committed by GitHub
parent 0f2beaca83
commit b8dad9817e
36 changed files with 13 additions and 71 deletions
-2
View File
@@ -25,8 +25,6 @@
# #
################################################################################
import datetime
import github.GithubObject
import github.PaginatedList
import github.NamedUser
-2
View File
@@ -24,8 +24,6 @@
# #
################################################################################
import urllib
import github.GithubObject
-8
View File
@@ -173,14 +173,6 @@ class IssueEvent(github.GithubObject.CompletableGithubObject):
self._completeIfNotSet(self._rename)
return self._rename.value
@property
def rename(self):
"""
:type: dict
"""
self._completeIfNotSet(self._rename)
return self._rename.value
@property
def dismissed_review(self):
"""
-3
View File
@@ -50,7 +50,6 @@
import datetime
import urllib
import pickle
import time
import sys
@@ -61,12 +60,10 @@ import urllib3
from Requester import Requester
import AuthenticatedUser
import NamedUser
import Organization
import Gist
import github.PaginatedList
import Repository
import Installation
import Legacy
import License
import Topic
import github.GithubObject
-1
View File
@@ -42,7 +42,6 @@
################################################################################
import datetime
import json
import github.GithubObject
import github.PaginatedList
-2
View File
@@ -42,8 +42,6 @@ try:
except ImportError:
from urlparse import parse_qs
import github.GithubObject
class PaginatedListBase:
def __init__(self):
-3
View File
@@ -22,9 +22,6 @@
# #
################################################################################
import datetime
import json
import github.GithubObject
import github.ProjectColumn
-2
View File
@@ -22,8 +22,6 @@
# #
################################################################################
import json
import github.GithubObject
# NOTE: There is currently no way to get cards "in triage" for a project.
-2
View File
@@ -22,8 +22,6 @@
# #
################################################################################
import json
import github.GithubObject
import github.Project
import github.ProjectCard
-1
View File
@@ -28,7 +28,6 @@
################################################################################
import github.GithubObject
import datetime
class Rate(github.GithubObject.NonCompletableGithubObject):
+1 -1
View File
@@ -325,7 +325,7 @@ class Requester:
data = data.decode("utf-8") # pragma no cover (Covered by Issue142.testDecodeJson with Python 3)
try:
return json.loads(data)
except ValueError, e:
except ValueError:
return {'data': data}
def requestJson(self, verb, url, parameters=None, headers=None, input=None, cnx=None):
+1 -3
View File
@@ -26,13 +26,11 @@
# #
################################################################################
import fnmatch
import os
import subprocess
import itertools
eightySharps = "################################################################################"
eightySharps = "#"*80
def generateLicenseSection(filename):
-1
View File
@@ -32,7 +32,6 @@
import Framework
import github
import datetime
-1
View File
@@ -28,7 +28,6 @@
################################################################################
import Framework
import github
class ConditionalRequestUpdate(Framework.TestCase):
-3
View File
@@ -32,9 +32,6 @@
import Framework
import github
import datetime
class ContentFile(Framework.TestCase):
def setUp(self):
-1
View File
@@ -38,7 +38,6 @@ import os
import zipfile
import datetime
import Framework
from pprint import pprint
class Release(Framework.TestCase):
-1
View File
@@ -26,7 +26,6 @@
import datetime
import Framework
from pprint import pprint
class ReleaseAsset(Framework.TestCase):
+2 -2
View File
@@ -1,9 +1,9 @@
import jwt
import json
import time
import time # NOQA
import sys
import unittest
import requests
import requests # NOQA
import datetime
from github.GithubObject import GithubObject
-1
View File
@@ -26,7 +26,6 @@
################################################################################
import Framework
import github
class Issue139(Framework.TestCase): # https://github.com/jacquev6/PyGithub/issues/139
-1
View File
@@ -26,7 +26,6 @@
################################################################################
import Framework
import github
class Issue140(Framework.TestCase): # https://github.com/jacquev6/PyGithub/issues/140
-1
View File
@@ -26,7 +26,6 @@
################################################################################
import Framework
import github
class Issue174(Framework.TestCase):
-2
View File
@@ -25,8 +25,6 @@
# #
################################################################################
import github
import Framework
-1
View File
@@ -26,7 +26,6 @@
################################################################################
import Framework
import github
# Replay data forged by capitalizing headers from PaginatedList.setUp.txt and PaginatedList.testIteration.txt
-2
View File
@@ -27,8 +27,6 @@
# #
################################################################################
import github
import Framework
-2
View File
@@ -27,8 +27,6 @@
# #
################################################################################
import github
import Framework
+1 -2
View File
@@ -23,7 +23,6 @@
################################################################################
import Framework
import github
class Issue937(Framework.TestCase):
def setUp(self):
@@ -35,4 +34,4 @@ class Issue937(Framework.TestCase):
collaborators = self.repo.get_collaborators(affiliation='direct')
self.assertListKeyEqual(collaborators, lambda u: u.login, ["hegde5"])
with self.assertRaises(AssertionError):
self.repo.get_collaborators(affiliation='invalid_option')
self.repo.get_collaborators(affiliation='invalid_option')
-2
View File
@@ -24,8 +24,6 @@
import Framework
import github
class Issue945(Framework.TestCase): # https://github.com/PyGithub/PyGithub/issues/945
def setUp(self):
-1
View File
@@ -33,7 +33,6 @@
import Framework
import github
import datetime
-2
View File
@@ -30,8 +30,6 @@
import Framework
import datetime
class Notification(Framework.TestCase):
def setUp(self):
+1 -1
View File
@@ -137,7 +137,7 @@ class PaginatedList(Framework.TestCase):
def testCustomPerPageWithNoUrlParams(self):
import CommitComment # Don't polute github.tests namespace, it would conflict with github.tests.CommitComment
self.g.per_page = 100
paginated_list = PaginatedListImpl(
PaginatedListImpl(
CommitComment.CommitComment,
self.repo._requester,
self.repo.url + "/comments",
+1 -1
View File
@@ -583,7 +583,7 @@ class Repository(Framework.TestCase):
def testMergeWithConflict(self):
with self.assertRaises(github.GithubException) as raisedexp:
commit = self.repo.merge("branchForBase", "branchForHead")
self.repo.merge("branchForBase", "branchForHead")
self.assertEqual(raisedexp.exception.status, 409)
self.assertEqual(raisedexp.exception.data, {"message": "Merge conflict"})
-2
View File
@@ -24,8 +24,6 @@
import Framework
import github
class RequiredPullRequestReviews(Framework.TestCase):
def setUp(self):
-2
View File
@@ -24,8 +24,6 @@
import Framework
import github
class RequiredStatusChecks(Framework.TestCase):
def setUp(self):
+5 -7
View File
@@ -75,10 +75,8 @@ class Retry(Framework.TestCase):
self.assertEquals(repository.full_name, REPO_NAME)
def testRaisesRetryErrorAfterMaxRetries(self):
try:
response = self.g.get_repo('PyGithub/PyGithub')
self.fail("RetryError should have been raised")
except requests.exceptions.RetryError:
self.assertEquals(len(httpretty.latest_requests), 4)
for request in httpretty.latest_requests:
self.assertEquals(request.path, '/repos/PyGithub/PyGithub')
with self.assertRaises(requests.exceptions.RetryError):
self.g.get_repo('PyGithub/PyGithub')
self.assertEquals(len(httpretty.latest_requests), 4)
for request in httpretty.latest_requests:
self.assertEquals(request.path, '/repos/PyGithub/PyGithub')
+1 -1
View File
@@ -20,7 +20,7 @@
# #
################################################################################
from datetime import datetime, timedelta, tzinfo
from datetime import timedelta, tzinfo
class UTCtzinfo(tzinfo):
def utcoffset(self, dt):
-1
View File
@@ -28,7 +28,6 @@
import Framework
import github
import datetime
class Traffic(Framework.TestCase):