Skip to content

Commit 12f1908

Browse files
committed
logger mocks
1 parent 9715fb8 commit 12f1908

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/tests_pytorch/loggers/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def mlflow_mock(monkeypatch):
3838
mlflow.tracking = mlflow_tracking
3939
mlflow.entities = mlflow_entities
4040

41+
monkeypatch.setattr("pytorch_lightning_enterprise.loggers.mlflow._MLFLOW_AVAILABLE", True)
42+
monkeypatch.setattr("pytorch_lightning_enterprise.loggers.mlflow._MLFLOW_SYNCHRONOUS_AVAILABLE", True)
4143
monkeypatch.setattr("pytorch_lightning_enterprise.utils.imports._MLFLOW_AVAILABLE", True)
4244
monkeypatch.setattr("pytorch_lightning_enterprise.utils.imports._MLFLOW_SYNCHRONOUS_AVAILABLE", True)
4345
return mlflow
@@ -86,6 +88,7 @@ class RunType: # to make isinstance checks pass
8688
wandb.sdk.lib = wandb_sdk_lib
8789
wandb.wandb_run = wandb_wandb_run
8890

91+
monkeypatch.setattr("pytorch_lightning_enterprise.loggers.wandb._WANDB_AVAILABLE", True)
8992
monkeypatch.setattr("pytorch_lightning_enterprise.utils.imports._WANDB_AVAILABLE", True)
9093
return wandb
9194

@@ -109,6 +112,7 @@ def comet_mock(monkeypatch):
109112
comet.start = Mock(name="comet_ml.start", return_value=comet.Experiment())
110113
comet.config = Mock()
111114

115+
monkeypatch.setattr("pytorch_lightning_enterprise.loggers.comet._COMET_AVAILABLE", True)
112116
monkeypatch.setattr("pytorch_lightning_enterprise.utils.imports._COMET_AVAILABLE", True)
113117
return comet
114118

@@ -156,5 +160,6 @@ def wait(self):
156160
neptune.types = neptune_types
157161
neptune.utils = neptune_utils
158162

163+
monkeypatch.setattr("pytorch_lightning_enterprise.loggers.neptune._NEPTUNE_AVAILABLE", True)
159164
monkeypatch.setattr("pytorch_lightning_enterprise.utils.imports._NEPTUNE_AVAILABLE", True)
160165
return neptune

0 commit comments

Comments
 (0)