Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
m9810223 committed Sep 27, 2024
1 parent ad246b1 commit 23425c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ pip install pytest-playwright-async

```py
# tests/conftest.py

import asyncio

import nest_asyncio
import nest_asyncio # pip install nest-asyncio
import pytest


@pytest.fixture(scope='session', autouse=True)
def event_loop(): # https://pytest-asyncio.readthedocs.io/en/latest/reference/fixtures.html#fixtures
def event_loop():
policy = asyncio.get_event_loop_policy()
loop = policy.new_event_loop()
nest_asyncio._patch_loop(loop) # *
Expand All @@ -33,13 +34,15 @@ def event_loop(): # https://pytest-asyncio.readthedocs.io/en/latest/reference/f


@pytest.fixture(scope='session', autouse=True)
# pip install anyio
def anyio_backend():
return 'asyncio'

```

```py
# tests/test_for_readme.py

from playwright.async_api import Page


Expand Down

0 comments on commit 23425c9

Please sign in to comment.