Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
m9810223 committed May 28, 2024
1 parent 211ed82 commit 56fc13a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ Source = "https://github.com/m9810223/playwright-async-pytest"
distribution = true

[tool.pdm.dev-dependencies]
dev = ["pytest>=7.4.0", "ipython>=8.12.2", "nest-asyncio>=1.5.6"]
dev = [
"pytest>=7.4.0",
"ipython>=8.12.2",
"nest-asyncio>=1.6.0",
]

[tool.pdm.scripts]
test = "pytest"
Expand Down Expand Up @@ -73,4 +77,4 @@ known-local-folder = []
ignore_missing_imports = true

[tool.pytest.ini_options]
addopts = "--exitfirst --failed-first -r fEsxXp --disable-warnings --showlocals --tb=short"
addopts = "--exitfirst --failed-first -r fEsxXp --showlocals --tb=short"
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import asyncio

import nest_asyncio
import pytest_asyncio


@pytest_asyncio.fixture(scope='session')
def event_loop(): # https://pytest-asyncio.readthedocs.io/en/latest/reference/fixtures.html#fixtures
policy = asyncio.get_event_loop_policy()
loop = policy.new_event_loop()
nest_asyncio.apply(loop)
yield loop
loop.close()
6 changes: 6 additions & 0 deletions tests/test_with_sync.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from playwright.sync_api import Page as SPage


def test_sync_api(page: SPage):
# access webpage
page.goto('https://playwright.dev/')

0 comments on commit 56fc13a

Please sign in to comment.