-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove auto_restart, add exception_handler
- Loading branch information
1 parent
0d60753
commit 2cd4944
Showing
2 changed files
with
52 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import pytest | ||
from anyio import sleep | ||
from pycrdt_websocket import exception_logger | ||
|
||
pytestmark = pytest.mark.anyio | ||
|
||
|
||
@pytest.mark.parametrize("websocket_server_api", ["websocket_server_start_stop"], indirect=True) | ||
@pytest.mark.parametrize("yws_server", [{"auto_restart": True}], indirect=True) | ||
@pytest.mark.parametrize("yws_server", [{"exception_handler": exception_logger}], indirect=True) | ||
async def test_server_restart(yws_server): | ||
port, server = yws_server | ||
|
||
async def raise_error(): | ||
raise RuntimeError("foo") | ||
|
||
server._task_group.start_soon(raise_error) | ||
server._task_group1.start_soon(raise_error) | ||
await sleep(0.1) |