File: conftest.py

package info (click to toggle)
python-inline-snapshot 0.23.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,116 kB
  • sloc: python: 6,888; makefile: 34; sh: 28
file content (16 lines) | stat: -rw-r--r-- 427 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import pytest

from inline_snapshot._external import DiscStorage
from tests.utils import snapshot_env
from tests.utils import useStorage


@pytest.fixture(autouse=True)
def snapshot_env_for_doctest(request, tmp_path):
    if hasattr(request.node, "dtest"):
        with snapshot_env():
            storage = DiscStorage(tmp_path / ".storage")
            with useStorage(storage):
                yield
    else:
        yield