diff --git a/did/stats.py b/did/stats.py index d1aca7cf..6ff9fca6 100644 --- a/did/stats.py +++ b/did/stats.py @@ -179,7 +179,7 @@ def check(self) -> None: try: f.result() except did.base.ReportError as error: - log.error("Skipping %s due to %s", f, error) + log.error("%s", error) sys.stdout.flush() sys.stderr.flush() diff --git a/did/utils.py b/did/utils.py index 9aca2fc3..bfb13aa5 100644 --- a/did/utils.py +++ b/did/utils.py @@ -521,7 +521,7 @@ def color( light_code = (1 if light else 0) # Starting and finishing sequence start = f"\033[{light_code}{text_color_code}{background_code}m" - finish = "\033[1;m" + finish = "\033[0m" return "".join([start, text, finish]) diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 6e999092..18ed22ca 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -238,7 +238,7 @@ def test_color_function_exists() -> None: # No color sets res = did.utils.color( "text", text_color=None, background=None, light=False, enabled=True) - assert res == "\033[0mtext\033[1;m" + assert res == "\033[0mtext\033[0m" # Disabled res = did.utils.color( "text", text_color=None, background=None, light=False, enabled=False) @@ -256,11 +256,11 @@ def test_color_function_exists() -> None: # Known color res = did.utils.color( "text", text_color="red", background=None, light=False, enabled=True) - assert res == "\033[0;31mtext\033[1;m" + assert res == "\033[0;31mtext\033[0m" # Light version res = did.utils.color( "text", text_color="red", background=None, light=True, enabled=True) - assert res == "\033[1;31mtext\033[1;m" + assert res == "\033[1;31mtext\033[0m" # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # strtobool