Skip to content

Commit

Permalink
Merge branch 'synapse_1_20' into transformers_future
Browse files Browse the repository at this point in the history
  • Loading branch information
regisss committed Mar 6, 2025
2 parents 9b7ca11 + 6d575e8 commit 73be6a2
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import json
import logging
import os
import sys
from pathlib import Path

import pytest

import tests.utils as oh_testutils


BASELINE_DIRECTORY = Path(__file__).parent.resolve() / Path("tests") / Path("baselines") / Path("fixture")

Expand Down Expand Up @@ -123,11 +122,19 @@ def pytest_sessionstart(session):
# use "gaudi1" since this is used in tests, baselines, etc.
device = "gaudi1"

oh_testutils.OH_DEVICE_CONTEXT = device
from tests import utils

utils.OH_DEVICE_CONTEXT = device
session.config.stash["device-context"] = device

# WA: delete the imported top-level tests module so we don't overshadow
# tests/transformers/tests module.
# This fixes python -m pytest tests/transformers/tests/models/ -s -v
del sys.modules["tests"]


def pytest_report_header():
return [f"device context: {oh_testutils.OH_DEVICE_CONTEXT}"]
def pytest_report_header(config):
return [f"device context: {config.stash['device-context']}"]


def pytest_sessionfinish(session):
Expand Down

0 comments on commit 73be6a2

Please sign in to comment.