Skip to content

Commit

Permalink
fix: simpler works better
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Sep 19, 2024
1 parent dd97008 commit 834d957
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/ape/cli/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,7 @@ def set_level(ctx, param, value):
if value.startswith("LOGLEVEL."):
value = value.split(".")[-1].strip()

if cli_logger._did_parse_sys_argv:
cli_logger.set_level(value)
else:
# Avoid callback without fully parsing sys argv first.
cli_logger._load_from_sys_argv(default=value)
cli_logger._load_from_sys_argv(default=value)

level_names = [lvl.name for lvl in LogLevel]
names_str = f"{', '.join(level_names[:-1])}, or {level_names[-1]}"
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/cli/test_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def test_vvv(runner, ape_cli):
Showing you can somehow use pytest's -v flag without
messing up Ape.
"""
result = runner.invoke(ape_cli, ("test", "-vvv", "--fixtures"))
result = runner.invoke(ape_cli, ("test", "-vvv", "--fixtures"), catch_exceptions=False)
assert result.exit_code == 0, result.output


Expand Down

0 comments on commit 834d957

Please sign in to comment.