diff --git a/tests/catalog/test_preparation.py b/tests/catalog/test_preparation.py index 07b248082..caec4d2d3 100644 --- a/tests/catalog/test_preparation.py +++ b/tests/catalog/test_preparation.py @@ -1,12 +1,11 @@ import glob import os import time -from datetime import timedelta from huggingface_hub.utils import GatedRepoError from unitxt.loaders import MissingKaggleCredentialsError from unitxt.logging_utils import get_logger -from unitxt.settings_utils import get_constants +from unitxt.settings_utils import get_constants, get_settings from unitxt.text_utils import print_dict from unitxt.utils import import_module_from_file @@ -14,6 +13,7 @@ logger = get_logger() constants = get_constants() +setting = get_settings() project_dir = os.path.dirname( os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -55,7 +55,9 @@ def test_preparations(self): self.assertTrue(True) elapsed_time = time.time() - start_time - formatted_time = str(timedelta(seconds=elapsed_time)) + minutes = int(elapsed_time // 60) + seconds = int(elapsed_time % 60) + formatted_time = f"{minutes:02}:{seconds:02}" logger.info( "\n_____________________________________________\n" f" Finished testing preparation file:\n {file}." @@ -63,10 +65,11 @@ def test_preparations(self): "\n_____________________________________________\n" ) - times[file] = formatted_time + times[file.split("prepare")[-1]] = formatted_time except Exception as e: logger.critical(f"Testing preparation file '{file}' failed:") raise e logger.critical("Preparation times table:") + times = dict(sorted(times.items(), key=lambda item: item[1], reverse=True)) print_dict(times, log_level="critical") diff --git a/tests/utils.py b/tests/utils.py index 0fc27b732..8a6e34efe 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -33,7 +33,7 @@ def setUpClass(cls): unitxt.settings.allow_unverified_code = True unitxt.settings.use_only_local_catalogs = True # unitxt.settings.global_loader_limit = 300 - unitxt.settings.max_log_message_size = 1000 + unitxt.settings.max_log_message_size = 1000000000000 if settings.default_verbosity in ["error", "critical"]: if not sys.warnoptions: warnings.simplefilter("ignore")