Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When possible reuse websocket sessions in tests #12221

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

anodos325
Copy link
Contributor

This is a minor optimization to open and use a single websocket client connection for the duration of the test. API consumers (for instance for HA tests) can import the PersistentCtx and run setup method with relevant arguments.

This is a minor optimization to open and use a single websocket
client connection for the duration of the test. API consumers
(for instance for HA tests) can import the PersistentCtx and
run setup method with relevant arguments.


@contextlib.contextmanager
def client(*, auth=undefined, auth_required=True, py_exceptions=True, log_py_exceptions=True, host_ip=None):
def client(*, auth=undefined, auth_required=True, py_exceptions=True, log_py_exceptions=True, host_ip=None, reuse_conn=True):
if reuse_conn and auth is undefined and host_ip is None and auth_required:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about other parameters (e.g. related to exceptions)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants