Skip to content

Commit 52d2168

Browse files
authored
docs(readme): simplify asyncio to asyncio.run() (microsoft#431)
1 parent 25a99d5 commit 52d2168

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async def main():
7373
await page.screenshot(path=f'example-{browser_type.name}.png')
7474
await browser.close()
7575

76-
asyncio.get_event_loop().run_until_complete(main())
76+
asyncio.run(main())
7777
```
7878

7979
#### With pytest
@@ -152,7 +152,7 @@ async def main():
152152
await page.screenshot(path='colosseum-iphone.png')
153153
await browser.close()
154154

155-
asyncio.get_event_loop().run_until_complete(main())
155+
asyncio.run(main())
156156
```
157157
</details>
158158

@@ -199,7 +199,7 @@ async def main():
199199
print(dimensions)
200200
await browser.close()
201201

202-
asyncio.get_event_loop().run_until_complete(main())
202+
asyncio.run(main())
203203
```
204204
</details>
205205

@@ -246,7 +246,7 @@ async def main():
246246
await page.goto('http://todomvc.com')
247247
await browser.close()
248248

249-
asyncio.get_event_loop().run_until_complete(main())
249+
asyncio.run(main())
250250
```
251251
</details>
252252

0 commit comments

Comments
 (0)