mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-25 14:20:45 +00:00
fix pytest
This commit is contained in:
parent
e1ff6d2e73
commit
fddb65d98b
@ -21,7 +21,11 @@ def test_critical(capsys, mocker):
|
|||||||
log.critical("foo")
|
log.critical("foo")
|
||||||
_, stderr = capsys.readouterr()
|
_, stderr = capsys.readouterr()
|
||||||
|
|
||||||
print("{}{}{}".format(colorama.Fore.RED, "CRITICAL: foo".rstrip(), colorama.Style.RESET_ALL))
|
print(
|
||||||
|
"{}CRITICAL: {}foo\n{}".format(
|
||||||
|
colorama.Fore.RED, colorama.Style.BRIGHT, colorama.Style.RESET_ALL
|
||||||
|
)
|
||||||
|
)
|
||||||
x, _ = capsys.readouterr()
|
x, _ = capsys.readouterr()
|
||||||
|
|
||||||
assert x == stderr
|
assert x == stderr
|
||||||
@ -32,7 +36,11 @@ def test_error(capsys, mocker):
|
|||||||
log.error("foo")
|
log.error("foo")
|
||||||
_, stderr = capsys.readouterr()
|
_, stderr = capsys.readouterr()
|
||||||
|
|
||||||
print("{}{}{}".format(colorama.Fore.RED, "ERROR: foo".rstrip(), colorama.Style.RESET_ALL))
|
print(
|
||||||
|
"{}ERROR: {}foo\n{}".format(
|
||||||
|
colorama.Fore.RED, colorama.Style.BRIGHT, colorama.Style.RESET_ALL
|
||||||
|
)
|
||||||
|
)
|
||||||
x, _ = capsys.readouterr()
|
x, _ = capsys.readouterr()
|
||||||
|
|
||||||
assert x == stderr
|
assert x == stderr
|
||||||
@ -43,7 +51,11 @@ def test_warn(capsys, mocker):
|
|||||||
log.warning("foo")
|
log.warning("foo")
|
||||||
stdout, _ = capsys.readouterr()
|
stdout, _ = capsys.readouterr()
|
||||||
|
|
||||||
print("{}{}{}".format(colorama.Fore.YELLOW, "WARNING: foo".rstrip(), colorama.Style.RESET_ALL))
|
print(
|
||||||
|
"{}WARNING: {}foo\n{}".format(
|
||||||
|
colorama.Fore.YELLOW, colorama.Style.BRIGHT, colorama.Style.RESET_ALL
|
||||||
|
)
|
||||||
|
)
|
||||||
x, _ = capsys.readouterr()
|
x, _ = capsys.readouterr()
|
||||||
|
|
||||||
assert x == stdout
|
assert x == stdout
|
||||||
@ -54,7 +66,11 @@ def test_info(capsys, mocker):
|
|||||||
log.info("foo")
|
log.info("foo")
|
||||||
stdout, _ = capsys.readouterr()
|
stdout, _ = capsys.readouterr()
|
||||||
|
|
||||||
print("{}{}{}".format(colorama.Fore.BLUE, "INFO: foo".rstrip(), colorama.Style.RESET_ALL))
|
print(
|
||||||
|
"{}INFO: {}foo\n{}".format(
|
||||||
|
colorama.Fore.BLUE, colorama.Style.BRIGHT, colorama.Style.RESET_ALL
|
||||||
|
)
|
||||||
|
)
|
||||||
x, _ = capsys.readouterr()
|
x, _ = capsys.readouterr()
|
||||||
|
|
||||||
assert x == stdout
|
assert x == stdout
|
||||||
|
Loading…
Reference in New Issue
Block a user