Skip to content

Commit

Permalink
test: fix other tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Sep 19, 2024
1 parent 41ac11a commit 0473208
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/functional/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def test_info_level_higher(simple_runner):
def cmd(cli_ctx):
cli_ctx.logger.info("this is a test")

logger._did_parse_sys_argv = False
result = simple_runner.invoke(group_for_testing, ("cmd", "-v", "WARNING"))

# You don't get INFO log when log level is higher
Expand All @@ -57,6 +58,7 @@ def test_warning_level_higher(simple_runner):
def cmd(cli_ctx):
cli_ctx.logger.warning("this is a test")

logger._did_parse_sys_argv = False
result = simple_runner.invoke(group_for_testing, ("cmd", "-v", "ERROR"))
assert "WARNING" not in result.output
assert "this is a test" not in result.output
Expand All @@ -71,6 +73,7 @@ def test_success(simple_runner):
def cmd(cli_ctx):
cli_ctx.logger.success("this is a test")

logger._did_parse_sys_argv = False
result = simple_runner.invoke(group_for_testing, "cmd")
assert "SUCCESS" in result.output
assert "this is a test" in result.output
Expand All @@ -82,6 +85,7 @@ def test_success_level_higher(simple_runner):
def cmd(cli_ctx):
cli_ctx.logger.success("this is a test")

logger._did_parse_sys_argv = False
result = simple_runner.invoke(group_for_testing, ("cmd", "-v", "WARNING"))
assert "SUCCESS" not in result.output
assert "this is a test" not in result.output
Expand Down

0 comments on commit 0473208

Please sign in to comment.