Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ known-first-party = ["fluss"]

[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
timeout = 30
asyncio_default_fixture_loop_scope = "function"
timeout = 120

[tool.mypy]
python_version = "3.9"
Expand Down
16 changes: 10 additions & 6 deletions bindings/python/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,16 @@ def fluss_cluster():
yield (plaintext_addr, sasl_addr or plaintext_addr)


@pytest_asyncio.fixture(scope="session")
_cached_connection = None


@pytest_asyncio.fixture
async def connection(fluss_cluster):
plaintext_addr, _sasl_addr = fluss_cluster
conn = await _connect(plaintext_addr)
yield conn
conn.close()
global _cached_connection
if _cached_connection is None:
plaintext_addr, _sasl_addr = fluss_cluster
_cached_connection = await _connect(plaintext_addr)
yield _cached_connection


@pytest.fixture(scope="session")
Expand All @@ -144,6 +148,6 @@ def plaintext_bootstrap_servers(fluss_cluster):
return plaintext_addr


@pytest_asyncio.fixture(scope="session")
@pytest_asyncio.fixture
async def admin(connection):
return connection.get_admin()
Loading