[nGraph][Py][Tests] Remove backup of old models (#1349)

This commit is contained in:
Tomasz Socha 2020-07-17 15:12:11 +02:00 committed by GitHub
parent 17287f20a0
commit 28227dcd9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,18 +72,6 @@ class ModelZooTestRunner(onnx.backend.test.BackendTest):
etag_file_path = os.path.join(model_dir, "source_tar_etag") etag_file_path = os.path.join(model_dir, "source_tar_etag")
open(etag_file_path, "w").write(etag_value) open(etag_file_path, "w").write(etag_value)
@staticmethod
def _backup_old_version(model_dir): # type: (str) -> None
if os.path.exists(model_dir):
backup_index = 0
while True:
dest = "{}.old.{}".format(model_dir, backup_index)
if os.path.exists(dest):
backup_index += 1
continue
shutil.move(model_dir, dest)
break
@classmethod @classmethod
@retry @retry
def prepare_model_data(cls, model_test): # type: (OnnxTestCase) -> Text def prepare_model_data(cls, model_test): # type: (OnnxTestCase) -> Text
@ -99,9 +87,6 @@ class ModelZooTestRunner(onnx.backend.test.BackendTest):
): ):
return model_dir return model_dir
# If model does exist, but is not current, backup directory
ModelZooTestRunner._backup_old_version(model_dir)
# Download and extract model and data # Download and extract model and data
download_file = tempfile.NamedTemporaryFile(delete=False) download_file = tempfile.NamedTemporaryFile(delete=False)
temp_clean_dir = tempfile.mkdtemp() temp_clean_dir = tempfile.mkdtemp()