Skip to content

Commit

Permalink
Try to make tests faster
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Normandin <[email protected]>
  • Loading branch information
lebrice committed Nov 19, 2024
1 parent daab5ac commit a013817
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions project/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
from __future__ import annotations

import copy
import functools
import operator
import os
import shlex
Expand All @@ -81,6 +82,8 @@
from hydra import compose, initialize_config_module
from hydra.conf import HydraHelpConf
from hydra.core.hydra_config import HydraConfig
from hydra_plugins.auto_schema import auto_schema_plugin
from hydra_plugins.auto_schema.auto_schema_plugin import add_schemas_to_all_hydra_configs
from omegaconf import DictConfig, open_dict
from torch import Tensor
from torch.utils.data import DataLoader
Expand Down Expand Up @@ -115,6 +118,11 @@
DEFAULT_TIMEOUT = 1.0
DEFAULT_SEED = 42

# Note: Here we attempt to make this happen only once.
auto_schema_plugin.add_schemas_to_all_hydra_configs = functools.cache(
add_schemas_to_all_hydra_configs
)


@pytest.fixture(autouse=True)
def original_datadir(original_datadir: Path):
Expand Down

0 comments on commit a013817

Please sign in to comment.