diff --git a/ansiblelater/logger.py b/ansiblelater/logger.py index bc01180..52fb7d2 100644 --- a/ansiblelater/logger.py +++ b/ansiblelater/logger.py @@ -158,25 +158,25 @@ def _get_critical_handler(json=False): def critical(message): """Format critical messages and return string.""" - return color_text(colorama.Fore.RED, message) + return color_text(colorama.Fore.RED, colorama.Fore.LIGHTRED_EX, message) def error(message): """Format error messages and return string.""" - return color_text(colorama.Fore.RED, message) + return color_text(colorama.Fore.RED, colorama.Fore.LIGHTRED_EX, message) def warn(message): """Format warn messages and return string.""" - return color_text(colorama.Fore.YELLOW, message) + return color_text(colorama.Fore.YELLOW, colorama.Fore.LIGHTYELLOW_EX, message) def info(message): """Format info messages and return string.""" - return color_text(colorama.Fore.BLUE, message) + return color_text(colorama.Fore.BLUE, colorama.Fore.LIGHTBLUE_EX, message) -def color_text(color, msg): +def color_text(color, light, msg): """ Colorize strings. @@ -185,5 +185,5 @@ def color_text(color, msg): :returns: string """ - msg = msg.format(colorama.Style.BRIGHT) + msg = msg.format(light) return "{}{}{}".format(color, msg, colorama.Style.RESET_ALL) diff --git a/ansiblelater/tests/__init__.py b/ansiblelater/test/__init__.py similarity index 100% rename from ansiblelater/tests/__init__.py rename to ansiblelater/test/__init__.py diff --git a/ansiblelater/tests/config/config.ini b/ansiblelater/test/config/config.ini similarity index 100% rename from ansiblelater/tests/config/config.ini rename to ansiblelater/test/config/config.ini diff --git a/ansiblelater/tests/config/standards.py b/ansiblelater/test/config/standards.py similarity index 100% rename from ansiblelater/tests/config/standards.py rename to ansiblelater/test/config/standards.py diff --git a/ansiblelater/tests/data/yaml_fail.yml b/ansiblelater/test/data/yaml_fail.yml similarity index 100% rename from ansiblelater/tests/data/yaml_fail.yml rename to ansiblelater/test/data/yaml_fail.yml diff --git a/ansiblelater/tests/data/yaml_success.yml b/ansiblelater/test/data/yaml_success.yml similarity index 100% rename from ansiblelater/tests/data/yaml_success.yml rename to ansiblelater/test/data/yaml_success.yml diff --git a/ansiblelater/tests/unit/test_logger.py b/ansiblelater/test/unit/test_logger.py similarity index 85% rename from ansiblelater/tests/unit/test_logger.py rename to ansiblelater/test/unit/test_logger.py index 440c19a..4026216 100644 --- a/ansiblelater/tests/unit/test_logger.py +++ b/ansiblelater/test/unit/test_logger.py @@ -23,7 +23,7 @@ def test_critical(capsys, mocker): print( "{}CRITICAL: {}foo\n{}".format( - colorama.Fore.RED, colorama.Style.BRIGHT, colorama.Style.RESET_ALL + colorama.Fore.RED, colorama.Fore.LIGHTRED_EX, colorama.Style.RESET_ALL ) ) x, _ = capsys.readouterr() @@ -38,7 +38,7 @@ def test_error(capsys, mocker): print( "{}ERROR: {}foo\n{}".format( - colorama.Fore.RED, colorama.Style.BRIGHT, colorama.Style.RESET_ALL + colorama.Fore.RED, colorama.Fore.LIGHTRED_EX, colorama.Style.RESET_ALL ) ) x, _ = capsys.readouterr() @@ -53,7 +53,7 @@ def test_warn(capsys, mocker): print( "{}WARNING: {}foo\n{}".format( - colorama.Fore.YELLOW, colorama.Style.BRIGHT, colorama.Style.RESET_ALL + colorama.Fore.YELLOW, colorama.Fore.LIGHTYELLOW_EX, colorama.Style.RESET_ALL ) ) x, _ = capsys.readouterr() @@ -68,7 +68,7 @@ def test_info(capsys, mocker): print( "{}INFO: {}foo\n{}".format( - colorama.Fore.BLUE, colorama.Style.BRIGHT, colorama.Style.RESET_ALL + colorama.Fore.BLUE, colorama.Fore.LIGHTBLUE_EX, colorama.Style.RESET_ALL ) ) x, _ = capsys.readouterr() diff --git a/ansiblelater/tests/unit/test_settings.py b/ansiblelater/test/unit/test_settings.py similarity index 94% rename from ansiblelater/tests/unit/test_settings.py rename to ansiblelater/test/unit/test_settings.py index 3630d2a..d5cbc79 100644 --- a/ansiblelater/tests/unit/test_settings.py +++ b/ansiblelater/test/unit/test_settings.py @@ -1,3 +1,5 @@ +"""Test settings module.""" + import pytest from ansiblelater import settings diff --git a/setup.cfg b/setup.cfg index 1f92f1c..cfe72d6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,6 +21,7 @@ coalesce_brackets = true split_before_logical_operator = true [tool:pytest] +addopts = --pyargs ansiblelater filterwarnings = ignore::FutureWarning ignore:.*collections.*:DeprecationWarning