File size: 616 Bytes
c7596ef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""Shared pytest fixtures.

The default pytest config (pyproject.toml) skips tests marked `gpu`. Opt in
to GPU smoke tests with `pytest -m gpu`.
"""

from __future__ import annotations

import sys
from pathlib import Path

import pytest

# Ensure repo root is importable as flat modules (matches z-image-studio convention).
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))


@pytest.fixture(autouse=True)
def _silence_mps_fallback_env(monkeypatch):
    """L1+L2 tests don't touch torch/mps; clear the env so test logs are clean."""
    monkeypatch.delenv("PYTORCH_ENABLE_MPS_FALLBACK", raising=False)