mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-12-01 03:14:21 +08:00
* test: await workspace limits on the pytest event loop Co-authored-by: multica-agent <github@multica.ai> * test: select the vector CI shard Co-authored-by: multica-agent <github@multica.ai> * test: isolate the session event loop policy Co-authored-by: multica-agent <github@multica.ai> --------- Co-authored-by: multica-agent <github@multica.ai>
21 lines
565 B
Python
21 lines
565 B
Python
"""Repository-wide test execution policy."""
|
|
|
|
import asyncio
|
|
|
|
import pytest
|
|
|
|
pytest_plugins = ['tests.utils.required_suites', 'tests.utils.plugin_installations']
|
|
|
|
|
|
@pytest.fixture(scope='session')
|
|
def event_loop_policy():
|
|
"""Start pytest-asyncio without an implicit loop for other runners to orphan."""
|
|
previous = asyncio.get_event_loop_policy()
|
|
policy = asyncio.DefaultEventLoopPolicy()
|
|
policy.set_event_loop(None)
|
|
asyncio.set_event_loop_policy(policy)
|
|
try:
|
|
yield policy
|
|
finally:
|
|
asyncio.set_event_loop_policy(previous)
|