# Context.testing
URL: https://lsd.tools/docs/api-context-testing
Updated: 2026-07-17

## Parameters

| name | type | default | description |
|---|---|---|---|
| `**fields` | `Any` | — | slot overrides — any of `host`, `engine`, `project`, `entity`, `selection`, `ui`, `viewer`, `panel`, `events` |

## Example

```python
ctx = Context.testing(project=my_project)

# override several slots at once
ctx = Context.testing(project=fake_project, ui=fake_ui)
```

## Notes

A classmethod on `Context`. Only the named slots are populated; every other slot stays `None`. Use it
to drive a command or action handler in a unit test without a running application.

## See also

**API:** [project](/docs/api-context-project) · [ui](/docs/api-context-ui) · [Context](/docs/api-context)

**Guides:** [Commands & actions](/docs/tools-commands-actions)
