-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WebsocketServer auto_restart parameter
- Loading branch information
1 parent
29bd17b
commit 37b96c1
Showing
5 changed files
with
45 additions
and
9 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
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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import pytest | ||
from anyio import sleep | ||
|
||
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) | ||
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) | ||
await sleep(0.1) |