Skip to content

Commit 0e486c1

Browse files
committed
Add request parameter to webapi_backend fixture and skip in standalone-only mode
1 parent 92609b6 commit 0e486c1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

datalab_kernel/tests/conftest.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,23 @@ def live_workspace(auto_datalab): # pylint: disable=redefined-outer-name
370370

371371

372372
@pytest.fixture
373-
def webapi_backend(auto_datalab): # pylint: disable=redefined-outer-name,unused-argument
373+
def webapi_backend(request, auto_datalab): # pylint: disable=redefined-outer-name,unused-argument
374374
"""Function-scoped fixture providing a WebApiBackend connected to DataLab.
375375
376376
In default mode: Uses auto-started DataLab.
377377
With flags: Uses DataLab started by datalab_instance fixture.
378378
379379
Returns a WebApiBackend instance connected to DataLab.
380380
Cleans up objects before and after each test to prevent contamination.
381+
382+
Skips test if running in standalone-only mode.
381383
"""
384+
# Skip if standalone-only mode (no DataLab available)
385+
if request.config.getoption("--standalone-only"):
386+
pytest.skip(
387+
"WebApiBackend tests require DataLab (skipped in standalone-only mode)"
388+
)
389+
382390
# pylint: disable=import-outside-toplevel
383391
from datalab_kernel.backends.webapi import WebApiBackend
384392

0 commit comments

Comments
 (0)