From e676e3631a304cc3db7e2b9b223013d463dbebc5 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 22 Sep 2023 14:02:30 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(conftest.py):=20set=20LANGFL?= =?UTF-8?q?OW=5FAUTO=5FLOGIN=20environment=20variable=20to=20False=20in=20?= =?UTF-8?q?client=5Ffixture=20and=20distributed=5Fclient=5Ffixture=20to=20?= =?UTF-8?q?disable=20auto=20login=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 63af8b473..0109845af 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -62,10 +62,11 @@ def session_fixture(): @pytest.fixture(name="client") -def client_fixture(session: Session): +def client_fixture(session: Session, monkeypatch): def get_session_override(): return session + monkeypatch.setenv("LANGFLOW_AUTO_LOGIN", False) from langflow.main import create_app app = create_app() @@ -104,6 +105,7 @@ def distributed_client_fixture(session: Session, monkeypatch, distributed_env): from langflow.services.manager import reinitialize_services, initialize_services # monkeypatch langflow.services.task.manager.USE_CELERY to True + monkeypatch.setenv("LANGFLOW_AUTO_LOGIN", False) monkeypatch.setattr(manager, "USE_CELERY", True) monkeypatch.setattr( celery_app, "celery_app", celery_app.make_celery("langflow", Config) @@ -120,6 +122,7 @@ def distributed_client_fixture(session: Session, monkeypatch, distributed_env): with TestClient(app) as client: yield client app.dependency_overrides.clear() + monkeypatch.undo() def get_graph(_type="basic"):