Skip to content

Commit 7c2386a

Browse files
committed
Disable sleeps in tests
1 parent 4a353f7 commit 7c2386a

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

tests/Authentication.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ def testAppAuthAuthenticationWithGithubIntegrationRequesterArgs(self):
180180
def testAppInstallationAuthAuthentication(self):
181181
# test data copied from testAppAuthentication to test parity
182182
installation_auth = github.Auth.AppInstallationAuth(self.app_auth, 29782936)
183-
g = github.Github(auth=installation_auth)
183+
g = github.Github(
184+
auth=installation_auth, lazy=False, seconds_between_requests=None, seconds_between_writes=None
185+
)
184186

185187
# token expires 2024-11-25 01:00:02
186188
token = installation_auth.token

tests/GithubIntegration.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ def testGetGithubForInstallation(self):
162162

163163
def testGetAccessToken(self):
164164
auth = github.Auth.AppAuth(APP_ID, PRIVATE_KEY)
165-
github_integration = github.GithubIntegration(auth=auth)
165+
github_integration = github.GithubIntegration(
166+
auth=auth, seconds_between_writes=None, seconds_between_requests=None
167+
)
166168

167169
# Get repo installation access token
168170
repo_installation_authorization = github_integration.get_access_token(self.repo_installation_id)

tests/Repository.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,8 @@ def testUnsubscribePubSubHubbub(self):
19921992
self.repo.unsubscribe_from_hub("push", "http://requestb.in/1bc1sc61")
19931993

19941994
def testStatisticsContributors(self):
1995-
stats = self.repo.get_stats_contributors()
1995+
with mock.patch("github.Requester.Consts.PROCESSING_202_WAIT_TIME", 0):
1996+
stats = self.repo.get_stats_contributors()
19961997
seenJacquev6 = False
19971998
for s in stats:
19981999
adTotal = 0
@@ -2011,7 +2012,8 @@ def testStatisticsContributors(self):
20112012
self.assertTrue(seenJacquev6)
20122013

20132014
def testStatisticsCommitActivity(self):
2014-
stats = self.repo.get_stats_commit_activity()
2015+
with mock.patch("github.Requester.Consts.PROCESSING_202_WAIT_TIME", 0):
2016+
stats = self.repo.get_stats_commit_activity()
20152017
self.assertEqual(
20162018
stats[0].week,
20172019
datetime(2012, 11, 18, 0, 0, tzinfo=timezone.utc),
@@ -2020,7 +2022,8 @@ def testStatisticsCommitActivity(self):
20202022
self.assertEqual(stats[0].days, [0, 7, 3, 9, 7, 3, 0])
20212023

20222024
def testStatisticsCodeFrequency(self):
2023-
stats = self.repo.get_stats_code_frequency()
2025+
with mock.patch("github.Requester.Consts.PROCESSING_202_WAIT_TIME", 0):
2026+
stats = self.repo.get_stats_code_frequency()
20242027
self.assertEqual(
20252028
stats[0].week,
20262029
datetime(2012, 2, 12, 0, 0, tzinfo=timezone.utc),
@@ -2029,7 +2032,8 @@ def testStatisticsCodeFrequency(self):
20292032
self.assertEqual(stats[0].deletions, -2098)
20302033

20312034
def testStatisticsParticipation(self):
2032-
stats = self.repo.get_stats_participation()
2035+
with mock.patch("github.Requester.Consts.PROCESSING_202_WAIT_TIME", 0):
2036+
stats = self.repo.get_stats_participation()
20332037
self.assertEqual(
20342038
stats.owner,
20352039
[
@@ -2146,7 +2150,8 @@ def testStatisticsParticipation(self):
21462150
)
21472151

21482152
def testStatisticsPunchCard(self):
2149-
stats = self.repo.get_stats_punch_card()
2153+
with mock.patch("github.Requester.Consts.PROCESSING_202_WAIT_TIME", 0):
2154+
stats = self.repo.get_stats_punch_card()
21502155
self.assertEqual(stats.get(4, 12), 7)
21512156
self.assertEqual(stats.get(6, 18), 2)
21522157

0 commit comments

Comments
 (0)