Skip to content

Use from Python

The pytest fixture and the lower-level HTTP client both ship in neops-remote-lab. Sixty seconds end-to-end below; deeper pages follow.

60-second start

Add the package to your project:

uv add neops-remote-lab

Adds the package to your pyproject.toml and locks it in uv.lock. See the uv docs for project workflows.

poetry add neops-remote-lab

Adds the package to your pyproject.toml [tool.poetry.dependencies] and locks it in poetry.lock.

pip install neops-remote-lab

Installs into the active virtualenv. Pin in requirements.txt for reproducibility.

Point at your Remote Lab Manager:

export REMOTE_LAB_URL=http://lab.example.com:8000
tests/conftest.py
from neops_remote_lab.testing.fixture import remote_lab_fixture

demo = remote_lab_fixture("demo.yml")
tests/test_demo.py
def test_demo_lab_has_two_devices(demo):
    assert len(demo) == 2
pytest tests/ -v

That’s the stable public API in three lines of test code. The fixture handles session creation, queue waiting, topology upload, and teardown. When the test ends — pass or fail — the lab is released cleanly.

Using this from the Worker SDK?

The Worker SDK imports remote_lab_fixture directly to give function-block tests a real topology. Two-step setup, then read Plug into Worker SDK and the SDK’s Remote lab testing guide.

In this section

  •   Pytest fixtures


    The full remote_lab_fixture API: factory arguments, the remote_lab_client session-scoped fixture, the one-fixture-per-test rule, fixture-rank ordering, end-to-end reuse_lab=True examples.

  •   With Worker SDK


    Remote-Lab-side notes for Worker SDK consumers — where to declare fixtures in the worker test layout, multi-vendor patterns, links into docs.neops.io.

  •   Python client


    RemoteLabClient for non-pytest contexts — scripts, notebooks, harnesses. Constructor, lifecycle, retry behaviour, swallow-and-log quirks of release() and destroy().

  •   Client config


    REMOTE_LAB_URL plus three timeout overrides. When to raise each; the timeout-coordination warning that prevents confusing CI failures.

  • Architecture — where the client sits relative to the server and LabManager.
  • Lab lifecycle — reference counting and reuse semantics that reuse_lab=True opts into.
  • REST API — the authoritative endpoint reference the Python client wraps.
  • Wire into CI — set the same env vars in GitHub Actions, GitLab CI, or Jenkins.