Skip to content

Commit 4500d55

Browse files
authored
add asgiref dep + set default timeout on page (#776)
* add asgiref dep + set default timeout on page * add changelog entry * Update display.py * Update config.py
1 parent 535d746 commit 4500d55

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

docs/source/about/changelog.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ more info, see the :ref:`Contributor Guide <Creating a Changelog Entry>`.
2323
Unreleased
2424
----------
2525

26-
No changes.
26+
**Added**
27+
28+
- :pull:`123` - ``asgiref`` as a dependency
29+
30+
**Changed**
31+
32+
- :pull:`123` - set default timeout on playwright page for testing
2733

2834

2935
v0.39.0

requirements/pkg-deps.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ jsonpatch >=1.32
55
fastjsonschema >=2.14.5
66
requests >=2
77
colorlog >=6
8+
asgiref >=3

src/idom/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080

8181
IDOM_TESTING_DEFAULT_TIMEOUT = _Option(
8282
"IDOM_TESTING_DEFAULT_TIMEOUT",
83-
3.0,
83+
5.0,
8484
mutable=False,
8585
validator=float,
8686
)
87+
"""A default timeout for testing utilities in IDOM"""

src/idom/testing/display.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from playwright.async_api import Browser, BrowserContext, Page, async_playwright
88

99
from idom import html
10+
from idom.config import IDOM_TESTING_DEFAULT_TIMEOUT
1011
from idom.types import RootComponentConstructor
1112

1213
from .backend import BackendFixture
@@ -57,6 +58,8 @@ async def __aenter__(self) -> DisplayFixture:
5758
browser = self._browser
5859
self.page = await browser.new_page()
5960

61+
self.page.set_default_timeout(IDOM_TESTING_DEFAULT_TIMEOUT.current * 1000)
62+
6063
if not hasattr(self, "backend"):
6164
self.backend = BackendFixture()
6265
await es.enter_async_context(self.backend)

0 commit comments

Comments
 (0)