mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-10 12:21:57 +08:00
Fix CometML tests (#585)
* monkeypatch atexit.register to fix problem with cometml logging * Use experiment id for version in cometml
This commit is contained in:
committed by
William Falcon
parent
c374c4fb80
commit
0489e31b02
+14
-2
@@ -106,8 +106,14 @@ def test_mlflow_pickle(tmpdir):
|
||||
trainer2.logger.log_metrics({"acc": 1.0})
|
||||
|
||||
|
||||
def test_comet_logger(tmpdir):
|
||||
def test_comet_logger(tmpdir, monkeypatch):
|
||||
"""Verify that basic functionality of Comet.ml logger works."""
|
||||
|
||||
# prevent comet logger from trying to print at exit, since
|
||||
# pytest's stdout/stderr redirection breaks it
|
||||
import atexit
|
||||
monkeypatch.setattr(atexit, "register", lambda _: None)
|
||||
|
||||
tutils.reset_seed()
|
||||
|
||||
try:
|
||||
@@ -140,8 +146,14 @@ def test_comet_logger(tmpdir):
|
||||
assert result == 1, "Training failed"
|
||||
|
||||
|
||||
def test_comet_pickle(tmpdir):
|
||||
def test_comet_pickle(tmpdir, monkeypatch):
|
||||
"""Verify that pickling trainer with comet logger works."""
|
||||
|
||||
# prevent comet logger from trying to print at exit, since
|
||||
# pytest's stdout/stderr redirection breaks it
|
||||
import atexit
|
||||
monkeypatch.setattr(atexit, "register", lambda _: None)
|
||||
|
||||
tutils.reset_seed()
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user