From 76aeab7c93561f643b19081b739ec7ba3276076a Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 24 Jul 2019 09:17:10 -0400 Subject: [PATCH] updated reqs --- tests/test_models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_models.py b/tests/test_models.py index c1c0ceab..2da111f4 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -40,7 +40,7 @@ def clear_tt_dir(): root_dir = os.path.dirname(os.path.realpath(__file__)) tt_dir = os.path.join(root_dir, 'tests_tt_dir') if os.path.exists(tt_dir): - os.remove(tt_dir) + os.rmdir(tt_dir) def assert_ok_acc(trainer): @@ -53,6 +53,8 @@ def test_cpu_model(): Make sure model trains on CPU :return: """ + clear_tt_dir() + model = get_model() trainer = Trainer( @@ -79,6 +81,7 @@ def test_single_gpu_model(): warnings.warn('test_single_gpu_model cannot run. Rerun on a GPU node to run this test') return + clear_tt_dir() model = get_model() trainer = Trainer( @@ -110,6 +113,7 @@ def test_multi_gpu_model_dp(): warnings.warn('test_multi_gpu_model_dp cannot run. Rerun on a node with 2+ GPUs to run this test') return + clear_tt_dir() model = get_model() trainer = Trainer( @@ -141,6 +145,7 @@ def test_multi_gpu_model_ddp(): warnings.warn('test_multi_gpu_model_ddp cannot run. Rerun on a node with 2+ GPUs to run this test') return + clear_tt_dir() model = get_model() trainer = Trainer( @@ -173,6 +178,7 @@ def test_amp_gpu_ddp(): warnings.warn('test_amp_gpu_ddp cannot run. Rerun on a node with 2+ GPUs to run this test') return + clear_tt_dir() model = get_model() trainer = Trainer( @@ -206,6 +212,7 @@ def test_amp_gpu_dp(): warnings.warn('test_amp_gpu_dp cannot run. Rerun on a node with 2+ GPUs to run this test') return + clear_tt_dir() model = get_model() trainer = Trainer( @@ -226,5 +233,6 @@ def test_amp_gpu_dp(): clear_tt_dir() + if __name__ == '__main__': pytest.main([__file__])