Skip to content

Commit

Permalink
remove no local test
Browse files Browse the repository at this point in the history
  • Loading branch information
f4hy committed Aug 8, 2020
1 parent a7cc9f8 commit 467fd64
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions tests/trainer/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,34 +988,3 @@ def setup(self, stage):
trainer.test(ckpt_path=None)
assert trainer.stage == 'test'
assert trainer.get_model().stage == 'test'


@pytest.fixture
def no_local_file_ops(monkeypatch):
monkeypatch.delattr(os.path, "exists")


def test_trainer_ensure_no_local_only_file_ops(tmpdir, monkeypatch, no_local_file_ops):
"""Currently file ops use helpers in cloud_io to ensure thigns work with local or remote files
We will monkeypatch to disable some problematic local only methods to
hopefully prevent any file ops from being added which only work locally """

monkeypatch.setenv('TORCH_HOME', str(tmpdir))

model = EvalModelTemplate()

# logger file to get meta
logger = tutils.get_default_logger(tmpdir)

trainer = Trainer(
default_root_dir=tmpdir,
max_epochs=1,
logger=logger,
checkpoint_callback=ModelCheckpoint(tmpdir),
)
# fit model
result = trainer.fit(model)
assert result == 1
# If this fails, make sure to only use file ops which work on both remote
# and local files

0 comments on commit 467fd64

Please sign in to comment.