Fix bug in parser and fix unit test

This commit is contained in:
Adam Yoblick 2024-07-24 00:02:17 -05:00
parent e3bf7a9665
commit bf4ce2b832
2 changed files with 6 additions and 6 deletions

View file

@ -202,11 +202,11 @@ def consume_argv():
def consume_args(args: list):
if (args is sys.argv):
yield from consume_argv()
while len(args) >= 1:
value = args[0]
del args[0]
yield value
else:
while len(args) >= 1:
value = args[0]
del args[0]
yield value
# Parse the args from the command line, then from the environment.
# Args from the environment are only used if they are not already set from the command line.

View file

@ -180,7 +180,7 @@ def test_address_required(cli):
def test_missing_target(cli):
with pytest.raises(ValueError) as ex:
cli(["--listen", "8888", "-m", ""])
cli(["--listen", "8888"])
assert "missing target" in str(ex.value)