Skip to content

Commit

Permalink
flake fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lezwon committed Jun 20, 2020
1 parent a3269e9 commit 03fe3b5
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions tests/trainer/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,28 +804,6 @@ def test_tpu_choice(tmpdir, tpu_cores, expected_tpu_id, error_expected):
assert trainer.tpu_id == expected_tpu_id


@pytest.mark.parametrize(['tpu_cores', 'expected_tpu_id', 'error_expected'], [
pytest.param(1, None, False),
pytest.param(8, None, False),
pytest.param([1], 1, False),
pytest.param([8], 8, False),
pytest.param('1,', 1, False),
pytest.param('1', None, False),
pytest.param('9, ', 9, True),
pytest.param([9], 9, True),
pytest.param([0], 0, True),
pytest.param(2, None, True),
pytest.param(10, None, True),
])
def test_tpu_choice(tmpdir, tpu_cores, expected_tpu_id, error_expected):
if error_expected:
with pytest.raises(MisconfigurationException, match=r'.*tpu_cores` can only be 1, 8 or [<1-8>]*'):
Trainer(default_root_dir=tmpdir, tpu_cores=tpu_cores, auto_select_gpus=True)
else:
trainer = Trainer(default_root_dir=tmpdir, tpu_cores=tpu_cores, auto_select_gpus=True)
assert trainer.tpu_id == expected_tpu_id


@pytest.mark.parametrize("trainer_kwargs,expected", [
pytest.param(
dict(distributed_backend=None, gpus=None),
Expand Down

0 comments on commit 03fe3b5

Please sign in to comment.