Fixes automatic parser bug (#1585)

* fixes gpu parsing

* fixes gpu parsing
This commit is contained in:
William Falcon
2020-04-23 21:00:41 -04:00
committed by GitHub
parent 3e8f2d99a9
commit 890458fdbd
4 changed files with 22 additions and 9 deletions
+1 -7
View File
@@ -259,6 +259,7 @@ def test_determine_root_gpu_device(gpus, expected_root_gpu):
pytest.param('0', [0]),
pytest.param('3', [3]),
pytest.param('1, 3', [1, 3]),
pytest.param('2,', [2]),
pytest.param('-1', list(range(PRETEND_N_OF_GPUS)), id="'-1' - use all gpus"),
])
def test_parse_gpu_ids(mocked_device_count, gpus, expected_gpu_ids):
@@ -281,13 +282,6 @@ def test_parse_gpu_fail_on_unsupported_inputs(mocked_device_count, gpus):
parse_gpu_ids(gpus)
@pytest.mark.gpus_param_tests
def test_parse_gpu_fail_on_empty_string(mocked_device_count):
# This currently results in a ValueError instead of MisconfigurationException
with pytest.raises(ValueError):
parse_gpu_ids('')
@pytest.mark.gpus_param_tests
@pytest.mark.parametrize("gpus", [[1, 2, 19], -1, '-1'])
def test_parse_gpu_fail_on_non_existant_id(mocked_device_count_0, gpus):