Skip to content

Docs: add pytest fixture recipe for isolated trace storage #29

@aaronlab

Description

@aaronlab

Context

BrowserTrace examples and tests often set BROWSERTRACE_HOME to a temporary directory so demo traces do not pollute ~/.browsertrace/. This pattern is useful for contributors and teams adding BrowserTrace to existing test suites, but it is not documented as a small copyable recipe yet.

Task

Add a short pytest-focused recipe to the examples docs. Keep it small and practical: show how to isolate trace storage with tmp_path and monkeypatch.setenv("BROWSERTRACE_HOME", str(tmp_path)), then create or run a trace without a browser, network, or API key.

Acceptance criteria

  • examples/README.md includes a compact pytest recipe for isolated BrowserTrace storage.
  • The recipe uses BROWSERTRACE_HOME with a temporary directory.
  • The text does not require API keys, hosted browser accounts, or network access.
  • Existing GitHub-tag install and uvx commands stay on v0.1.14 while PyPI is pending.
  • Run uv run --python 3.11 --extra dev pytest -q before opening a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions