From 3b56e3395ccbbf5c2374ef36917e962ff1372d40 Mon Sep 17 00:00:00 2001 From: nichmor Date: Thu, 4 Jul 2024 13:10:45 +0300 Subject: [PATCH] fix: slow test when rb is not present (#163) --- src/repror/internals/config.py | 2 +- src/repror/internals/print.py | 4 ++++ tests/test_build.py | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/repror/internals/config.py b/src/repror/internals/config.py index 6afab95..c384608 100644 --- a/src/repror/internals/config.py +++ b/src/repror/internals/config.py @@ -108,7 +108,7 @@ def load_all_recipes(config_path: str = "config.yaml") -> list[RecipeDB | Remote for repo, recipes in recipes_to_fetch.items() ], ) - [save(recipe) for recipe in recipes for recipes in remote_recipes] + [save(recipe) for repo_recipes in remote_recipes for recipe in repo_recipes] [recipes.extend(recipe_list) for recipe_list in remote_recipes] for local in config.local: diff --git a/src/repror/internals/print.py b/src/repror/internals/print.py index f384400..9f21cd7 100644 --- a/src/repror/internals/print.py +++ b/src/repror/internals/print.py @@ -3,6 +3,7 @@ import platform from rich import print as rich_print +from rich.table import Table from typing import Any, IO, Optional from .options import global_options @@ -58,6 +59,9 @@ def print( logging.debug("Disabled output") return + if objects and isinstance(objects[0], Table): + return rich_print(*objects, sep=sep, end=end, file=file, flush=flush) + if platform.system() == "Windows": return rich_print( strip_emojis(*objects), sep=sep, end=end, file=file, flush=flush diff --git a/tests/test_build.py b/tests/test_build.py index 33555d7..c8f4d4a 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -34,6 +34,8 @@ def test_build_boltons( test_config_yaml_path, "build-recipe", "boltons", + "--rattler-build-exe", + "non_existing", ], catch_exceptions=False, ) @@ -47,6 +49,8 @@ def test_build_boltons( test_config_yaml_path, "build-recipe", "boltons", + "--rattler-build-exe", + "non_existing", ], catch_exceptions=False, ) @@ -89,6 +93,8 @@ def test_rebuild_build_boltons( test_config_yaml_path, "rebuild-recipe", "boltons", + "--rattler-build-exe", + "non_existing", ], catch_exceptions=False, ) @@ -101,6 +107,8 @@ def test_rebuild_build_boltons( test_config_yaml_path, "rebuild-recipe", "boltons", + "--rattler-build-exe", + "non_existing", ], catch_exceptions=False, )