Skip to content

Commit a1b11ae

Browse files
committed
Fix example
1 parent 68080f7 commit a1b11ae

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

examples/github_stats/app.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,25 @@
2424
dispatch = Dispatch(app)
2525

2626

27-
@dispatch.function()
28-
def get_repo_info(repo_owner: str, repo_name: str):
27+
@dispatch.function
28+
async def get_repo_info(repo_owner: str, repo_name: str):
2929
url = f"https://api.github.com/repos/{repo_owner}/{repo_name}"
3030
api_response = httpx.get(url)
3131
api_response.raise_for_status()
3232
repo_info = api_response.json()
3333
return repo_info
3434

3535

36-
@dispatch.function()
37-
def get_contributors(repo_info: dict):
36+
@dispatch.function
37+
async def get_contributors(repo_info: dict):
3838
contributors_url = repo_info["contributors_url"]
3939
response = httpx.get(contributors_url)
4040
response.raise_for_status()
4141
contributors = response.json()
4242
return contributors
4343

4444

45-
@dispatch.coroutine()
45+
@dispatch.function
4646
async def main():
4747
repo_info = await get_repo_info("stealthrocket", "coroutine")
4848
print(

examples/github_stats/test_app.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def test_foo(self):
3636
response = http_client.get("/")
3737
self.assertEqual(response.status_code, 200)
3838

39-
server.execute(app_client)
4039
server.execute(app_client)
4140

4241
self.assertEqual(len(servicer.responses), 1)

0 commit comments

Comments
 (0)