diff --git a/conftest.py b/conftest.py index c0fe27ba..c09fe17b 100644 --- a/conftest.py +++ b/conftest.py @@ -403,6 +403,13 @@ def make_repo(capsys, request, config, tunnel, users): # 'allow_merge_commit': False, 'allow_rebase_merge': False, })) + r = r.json() + # wait for repository visibility + while True: + time.sleep(1) + if github.head(r['url']).ok: + break + repo = Repo(github, fullname, repos) # create webhook @@ -415,6 +422,7 @@ def make_repo(capsys, request, config, tunnel, users): }, 'events': ['pull_request', 'issue_comment', 'status', 'pull_request_review'] })) + time.sleep(1) check(github.put('{}/contents/{}'.format(repo_url, 'a'), json={ 'path': 'a', @@ -422,8 +430,7 @@ def make_repo(capsys, request, config, tunnel, users): 'content': base64.b64encode(b'whee').decode('ascii'), 'branch': 'garbage_%s' % uuid.uuid4() })) - # try to unwatch repo, doesn't actually work - repo.unsubscribe() + time.sleep(1) return repo yield repomaker