Dear Maintainer,
To reproduce this locally, you need to install python3-click from experimental
on an unstable system or build chroot. Like this:
autopkgtest --add-apt-source='deb http://deb.debian.org/debian experimental main' --pin-package=experimental=src:python-click -U . -- unshare -r unstable -t ~/.cache/sbuild/unstable-amd64.tar
The full build log is available at
https://ci.debian.net/packages/p/python-softlayer/unstable/amd64/72934393/
Relevant part (hopefully):
=================================== FAILURES ===================================
tests/CLI/modules/dedicatedhost_tests.py:388: AssertionError
tests/CLI/modules/dedicatedhost_tests.py:359: AssertionError
tests/CLI/modules/file_tests.py:814: AssertionError
tests/CLI/modules/file_tests.py:821: AssertionError
tests/CLI/modules/hardware/hardware_basic_tests.py:1011: AssertionError
tests/CLI/modules/subnet_tests.py:186: AssertionError
^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1435:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/click/core.py:1902: in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1900: in invoke
sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1245: in make_context
self.parse_args(ctx, args)
/usr/lib/python3/dist-packages/click/core.py:1256: in parse_args
_, args = param.handle_parse_result(ctx, opts, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:2583: in handle_parse_result
value, source = self.consume_value(ctx, opts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:3354: in consume_value
value = self.prompt_for_value(ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:3215: in prompt_for_value
return prompt(
/usr/lib/python3/dist-packages/click/termui.py:179: in prompt
value = prompt_func(prompt)
^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
text = 'Hostname [vs-test-like]: '
def prompt_func(text: str) -> str:
f = hidden_prompt_func if hide_input else visible_prompt_func
try:
# Write the prompt separately so that we get nice
# coloring through colorama on Windows
echo(text[:-1], nl=False, err=err)
# Echo the last character to stdout to work around an issue where
# readline causes backspace to clear the whole line.
return f(text[-1:])
except (KeyboardInterrupt, EOFError):
# getpass doesn't print a newline if the user aborts input with ^C.
# Allegedly this behavior is inherited from getpass(3).
# A doc bug has been filed at https://bugs.python.org/issue24711
if hide_input:
echo(None, err=err)
E click.exceptions.Abort
/usr/lib/python3/dist-packages/click/termui.py:162: Abort
During handling of the above exception, another exception occurred:
self = <tests.CLI.modules.vs.vs_create_tests.VirtCreateTests testMethod=test_create_like>
confirm_mock = <MagicMock name='confirm' id='140113450989760'>
@mock.patch('SoftLayer.CLI.formatting.confirm')
def test_create_like(self, confirm_mock):
mock = self.set_mock('SoftLayer_Virtual_Guest', 'getObject')
mock.return_value = {
'hostname': 'vs-test-like',
'domain': 'test.sftlyr.ws',
'maxCpu': 2,
'maxMemory': 1024,
'datacenter': {'name': 'dal05'},
'networkComponents': [{'maxSpeed': 100}],
'dedicatedAccountHostOnlyFlag': False,
'privateNetworkOnlyFlag': False,
'billingItem': {'orderItem': {'preset': {}}},
'operatingSystem': {'softwareLicense': {
'softwareDescription': {'referenceCode': 'UBUNTU_LATEST'}
}},
'hourlyBillingFlag': False,
'localDiskFlag': True,
'userData': {}
}
confirm_mock.return_value = True
result = self.run_command(['vs', 'create',
'--like=123',
'--san',
'--billing=hourly'])
tests/CLI/modules/vs/vs_create_tests.py:390:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/SoftLayer/testing/__init__.py:159: in assert_no_fail
raise result.exception
/usr/lib/python3/dist-packages/click/testing.py:596: in invoke
return_value = cli.main(args=args or (), prog_name=prog_name, **extra)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <CommandLoader cli>
args = ['vs', 'create', '--like=123', '--san', '--billing=hourly']
prog_name = 'cli', complete_var = None, standalone_mode = True
windows_expand_args = True
extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebca150>}
def main(
self,
args: cabc.Sequence[str] | None = None,
prog_name: str | None = None,
complete_var: str | None = None,
standalone_mode: bool = True,
windows_expand_args: bool = True,
**extra: t.Any,
) -> t.Any:
"""This is the way to invoke a script with all the bells and
whistles as a command line application. This will always terminate
the application after a call. If this is not wanted, ``SystemExit``
needs to be caught.
This method is also available by directly calling the instance of
a :class:`Command`.
:param args: the arguments that should be used for parsing. If not
provided, ``sys.argv[1:]`` is used.
:param prog_name: the program name that should be used. By default
the program name is constructed by taking the file
name from ``sys.argv[0]``.
:param complete_var: the environment variable that controls the
bash completion support. The default is
``"_<prog_name>_COMPLETE"`` with prog_name in
uppercase.
:param standalone_mode: the default behavior is to invoke the script
in standalone mode. Click will then
handle exceptions and convert them into
error messages and the function will never
return but shut down the interpreter. If
this is set to `False` they will be
propagated to the caller and the return
value of this function is the return value
of :meth:`invoke`.
:param windows_expand_args: Expand glob patterns, user dir, and
env vars in command line args on Windows.
:param extra: extra keyword arguments are forwarded to the context
constructor. See :class:`Context` for more information.
.. versionchanged:: 8.0.1
Added the ``windows_expand_args`` parameter to allow
disabling command line arg expansion on Windows.
.. versionchanged:: 8.0
When taking arguments from ``sys.argv`` on Windows, glob
patterns, user dir, and env vars are expanded.
.. versionchanged:: 3.0
Added the ``standalone_mode`` parameter.
"""
if args is None:
args = sys.argv[1:]
if os.name == "nt" and windows_expand_args:
args = _expand_args(args)
else:
args = list(args)
if prog_name is None:
prog_name = _detect_program_name()
# Process shell completion requests and exit early.
self._main_shell_completion(extra, prog_name, complete_var)
try:
try:
with self.make_context(prog_name, args, **extra) as ctx:
rv = self.invoke(ctx)
if not standalone_mode:
return rv
# it's not safe to `ctx.exit(rv)` here!
# note that `rv` may actually contain data like "1" which
# has obvious effects
# more subtle case: `rv=[None, None]` can come out of
# chained commands which all returned `None` -- so it's not
# even always obvious that `rv` indicates success/failure
# by its truthiness/falsiness
ctx.exit()
except (EOFError, KeyboardInterrupt) as e:
echo(file=sys.stderr)
raise Abort() from e
except ClickException as e:
if not standalone_mode:
raise
e.show()
sys.exit(e.exit_code)
except OSError as e:
if e.errno == errno.EPIPE:
sys.stdout = t.cast(t.TextIO, PacifyFlushWrapper(sys.stdout))
sys.stderr = t.cast(t.TextIO, PacifyFlushWrapper(sys.stderr))
sys.exit(1)
else:
raise
except Exit as e:
if standalone_mode:
sys.exit(e.exit_code)
else:
# in non-standalone mode, return the exit code
# note that this is only reached if `self.invoke` above raises
# an Exit explicitly -- thus bypassing the check there which
# would return its result
# the results of non-standalone execution may therefore be
# somewhat ambiguous: if there are codepaths which lead to
# `ctx.exit(1)` and to `return 1`, the caller won't be able to
# tell the difference between the two
return e.exit_code
except Abort:
if not standalone_mode:
raise
echo(_("Aborted!"), file=sys.stderr)
/usr/lib/python3/dist-packages/click/core.py:1478: SystemExit
----------------------------- Captured stdout call -----------------------------
1
^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1435:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/click/core.py:1902: in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1900: in invoke
sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1245: in make_context
self.parse_args(ctx, args)
/usr/lib/python3/dist-packages/click/core.py:1256: in parse_args
_, args = param.handle_parse_result(ctx, opts, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:2583: in handle_parse_result
value, source = self.consume_value(ctx, opts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:3354: in consume_value
value = self.prompt_for_value(ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:3215: in prompt_for_value
return prompt(
/usr/lib/python3/dist-packages/click/termui.py:179: in prompt
value = prompt_func(prompt)
^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
text = 'Hostname [vs-test-like]: '
def prompt_func(text: str) -> str:
f = hidden_prompt_func if hide_input else visible_prompt_func
try:
# Write the prompt separately so that we get nice
# coloring through colorama on Windows
echo(text[:-1], nl=False, err=err)
# Echo the last character to stdout to work around an issue where
# readline causes backspace to clear the whole line.
return f(text[-1:])
except (KeyboardInterrupt, EOFError):
# getpass doesn't print a newline if the user aborts input with ^C.
# Allegedly this behavior is inherited from getpass(3).
# A doc bug has been filed at https://bugs.python.org/issue24711
if hide_input:
echo(None, err=err)
E click.exceptions.Abort
/usr/lib/python3/dist-packages/click/termui.py:162: Abort
During handling of the above exception, another exception occurred:
self = <tests.CLI.modules.vs.vs_create_tests.VirtCreateTests testMethod=test_create_like_flavor>
confirm_mock = <MagicMock name='confirm' id='140113372789264'>
@mock.patch('SoftLayer.CLI.formatting.confirm')
def test_create_like_flavor(self, confirm_mock):
mock = self.set_mock('SoftLayer_Virtual_Guest', 'getObject')
mock.return_value = {
'hostname': 'vs-test-like',
'domain': 'test.sftlyr.ws',
'maxCpu': 2,
'maxMemory': 1024,
'datacenter': {'name': 'dal05'},
'networkComponents': [{'maxSpeed': 100}],
'dedicatedAccountHostOnlyFlag': False,
'privateNetworkOnlyFlag': False,
'billingItem': {'orderItem': {'preset': {'keyName': 'B1_1X2X25'}}},
'operatingSystem': {'softwareLicense': {
'softwareDescription': {'referenceCode': 'UBUNTU_LATEST'}
}},
'hourlyBillingFlag': True,
'localDiskFlag': False,
'userData': {}
}
confirm_mock.return_value = True
result = self.run_command(['vs', 'create', '--like=123'])
tests/CLI/modules/vs/vs_create_tests.py:504:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/SoftLayer/testing/__init__.py:159: in assert_no_fail
raise result.exception
/usr/lib/python3/dist-packages/click/testing.py:596: in invoke
return_value = cli.main(args=args or (), prog_name=prog_name, **extra)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <CommandLoader cli>, args = ['vs', 'create', '--like=123']
prog_name = 'cli', complete_var = None, standalone_mode = True
windows_expand_args = True
extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebca410>}
def main(
self,
args: cabc.Sequence[str] | None = None,
prog_name: str | None = None,
complete_var: str | None = None,
standalone_mode: bool = True,
windows_expand_args: bool = True,
**extra: t.Any,
) -> t.Any:
"""This is the way to invoke a script with all the bells and
whistles as a command line application. This will always terminate
the application after a call. If this is not wanted, ``SystemExit``
needs to be caught.
This method is also available by directly calling the instance of
a :class:`Command`.
:param args: the arguments that should be used for parsing. If not
provided, ``sys.argv[1:]`` is used.
:param prog_name: the program name that should be used. By default
the program name is constructed by taking the file
name from ``sys.argv[0]``.
:param complete_var: the environment variable that controls the
bash completion support. The default is
``"_<prog_name>_COMPLETE"`` with prog_name in
uppercase.
:param standalone_mode: the default behavior is to invoke the script
in standalone mode. Click will then
handle exceptions and convert them into
error messages and the function will never
return but shut down the interpreter. If
this is set to `False` they will be
propagated to the caller and the return
value of this function is the return value
of :meth:`invoke`.
:param windows_expand_args: Expand glob patterns, user dir, and
env vars in command line args on Windows.
:param extra: extra keyword arguments are forwarded to the context
constructor. See :class:`Context` for more information.
.. versionchanged:: 8.0.1
Added the ``windows_expand_args`` parameter to allow
disabling command line arg expansion on Windows.
.. versionchanged:: 8.0
When taking arguments from ``sys.argv`` on Windows, glob
patterns, user dir, and env vars are expanded.
.. versionchanged:: 3.0
Added the ``standalone_mode`` parameter.
"""
if args is None:
args = sys.argv[1:]
if os.name == "nt" and windows_expand_args:
args = _expand_args(args)
else:
args = list(args)
if prog_name is None:
prog_name = _detect_program_name()
# Process shell completion requests and exit early.
self._main_shell_completion(extra, prog_name, complete_var)
try:
try:
with self.make_context(prog_name, args, **extra) as ctx:
rv = self.invoke(ctx)
if not standalone_mode:
return rv
# it's not safe to `ctx.exit(rv)` here!
# note that `rv` may actually contain data like "1" which
# has obvious effects
# more subtle case: `rv=[None, None]` can come out of
# chained commands which all returned `None` -- so it's not
# even always obvious that `rv` indicates success/failure
# by its truthiness/falsiness
ctx.exit()
except (EOFError, KeyboardInterrupt) as e:
echo(file=sys.stderr)
raise Abort() from e
except ClickException as e:
if not standalone_mode:
raise
e.show()
sys.exit(e.exit_code)
except OSError as e:
if e.errno == errno.EPIPE:
sys.stdout = t.cast(t.TextIO, PacifyFlushWrapper(sys.stdout))
sys.stderr = t.cast(t.TextIO, PacifyFlushWrapper(sys.stderr))
sys.exit(1)
else:
raise
except Exit as e:
if standalone_mode:
sys.exit(e.exit_code)
else:
# in non-standalone mode, return the exit code
# note that this is only reached if `self.invoke` above raises
# an Exit explicitly -- thus bypassing the check there which
# would return its result
# the results of non-standalone execution may therefore be
# somewhat ambiguous: if there are codepaths which lead to
# `ctx.exit(1)` and to `return 1`, the caller won't be able to
# tell the difference between the two
return e.exit_code
except Abort:
if not standalone_mode:
raise
echo(_("Aborted!"), file=sys.stderr)
/usr/lib/python3/dist-packages/click/core.py:1478: SystemExit
----------------------------- Captured stdout call -----------------------------
1
^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1435:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/click/core.py:1902: in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1900: in invoke
sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1245: in make_context
self.parse_args(ctx, args)
/usr/lib/python3/dist-packages/click/core.py:1256: in parse_args
_, args = param.handle_parse_result(ctx, opts, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:2583: in handle_parse_result
value, source = self.consume_value(ctx, opts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:3354: in consume_value
value = self.prompt_for_value(ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:3215: in prompt_for_value
return prompt(
/usr/lib/python3/dist-packages/click/termui.py:179: in prompt
value = prompt_func(prompt)
^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
text = 'Hostname [vs-test-like]: '
def prompt_func(text: str) -> str:
f = hidden_prompt_func if hide_input else visible_prompt_func
try:
# Write the prompt separately so that we get nice
# coloring through colorama on Windows
echo(text[:-1], nl=False, err=err)
# Echo the last character to stdout to work around an issue where
# readline causes backspace to clear the whole line.
return f(text[-1:])
except (KeyboardInterrupt, EOFError):
# getpass doesn't print a newline if the user aborts input with ^C.
# Allegedly this behavior is inherited from getpass(3).
# A doc bug has been filed at https://bugs.python.org/issue24711
if hide_input:
echo(None, err=err)
E click.exceptions.Abort
/usr/lib/python3/dist-packages/click/termui.py:162: Abort
During handling of the above exception, another exception occurred:
self = <tests.CLI.modules.vs.vs_create_tests.VirtCreateTests testMethod=test_create_like_image>
confirm_mock = <MagicMock name='confirm' id='140113450988752'>
@mock.patch('SoftLayer.CLI.formatting.confirm')
def test_create_like_image(self, confirm_mock):
mock = self.set_mock('SoftLayer_Virtual_Guest', 'getObject')
mock.return_value = {
'hostname': 'vs-test-like',
'domain': 'test.sftlyr.ws',
'maxCpu': 2,
'maxMemory': 1024,
'datacenter': {'name': 'dal05'},
'networkComponents': [{'maxSpeed': 100}],
'dedicatedAccountHostOnlyFlag': False,
'privateNetworkOnlyFlag': False,
'billingItem': {'orderItem': {'preset': {}}},
'blockDeviceTemplateGroup': {'globalIdentifier': 'aaa1xxx1122233'},
'hourlyBillingFlag': False,
'localDiskFlag': True,
'userData': {},
}
confirm_mock.return_value = True
result = self.run_command(['vs', 'create',
'--like=123',
'--san',
'--billing=hourly'])
tests/CLI/modules/vs/vs_create_tests.py:465:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/SoftLayer/testing/__init__.py:159: in assert_no_fail
raise result.exception
/usr/lib/python3/dist-packages/click/testing.py:596: in invoke
return_value = cli.main(args=args or (), prog_name=prog_name, **extra)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <CommandLoader cli>
args = ['vs', 'create', '--like=123', '--san', '--billing=hourly']
prog_name = 'cli', complete_var = None, standalone_mode = True
windows_expand_args = True
extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebca8e0>}
def main(
self,
args: cabc.Sequence[str] | None = None,
prog_name: str | None = None,
complete_var: str | None = None,
standalone_mode: bool = True,
windows_expand_args: bool = True,
**extra: t.Any,
) -> t.Any:
"""This is the way to invoke a script with all the bells and
whistles as a command line application. This will always terminate
the application after a call. If this is not wanted, ``SystemExit``
needs to be caught.
This method is also available by directly calling the instance of
a :class:`Command`.
:param args: the arguments that should be used for parsing. If not
provided, ``sys.argv[1:]`` is used.
:param prog_name: the program name that should be used. By default
the program name is constructed by taking the file
name from ``sys.argv[0]``.
:param complete_var: the environment variable that controls the
bash completion support. The default is
``"_<prog_name>_COMPLETE"`` with prog_name in
uppercase.
:param standalone_mode: the default behavior is to invoke the script
in standalone mode. Click will then
handle exceptions and convert them into
error messages and the function will never
return but shut down the interpreter. If
this is set to `False` they will be
propagated to the caller and the return
value of this function is the return value
of :meth:`invoke`.
:param windows_expand_args: Expand glob patterns, user dir, and
env vars in command line args on Windows.
:param extra: extra keyword arguments are forwarded to the context
constructor. See :class:`Context` for more information.
.. versionchanged:: 8.0.1
Added the ``windows_expand_args`` parameter to allow
disabling command line arg expansion on Windows.
.. versionchanged:: 8.0
When taking arguments from ``sys.argv`` on Windows, glob
patterns, user dir, and env vars are expanded.
.. versionchanged:: 3.0
Added the ``standalone_mode`` parameter.
"""
if args is None:
args = sys.argv[1:]
if os.name == "nt" and windows_expand_args:
args = _expand_args(args)
else:
args = list(args)
if prog_name is None:
prog_name = _detect_program_name()
# Process shell completion requests and exit early.
self._main_shell_completion(extra, prog_name, complete_var)
try:
try:
with self.make_context(prog_name, args, **extra) as ctx:
rv = self.invoke(ctx)
if not standalone_mode:
return rv
# it's not safe to `ctx.exit(rv)` here!
# note that `rv` may actually contain data like "1" which
# has obvious effects
# more subtle case: `rv=[None, None]` can come out of
# chained commands which all returned `None` -- so it's not
# even always obvious that `rv` indicates success/failure
# by its truthiness/falsiness
ctx.exit()
except (EOFError, KeyboardInterrupt) as e:
echo(file=sys.stderr)
raise Abort() from e
except ClickException as e:
if not standalone_mode:
raise
e.show()
sys.exit(e.exit_code)
except OSError as e:
if e.errno == errno.EPIPE:
sys.stdout = t.cast(t.TextIO, PacifyFlushWrapper(sys.stdout))
sys.stderr = t.cast(t.TextIO, PacifyFlushWrapper(sys.stderr))
sys.exit(1)
else:
raise
except Exit as e:
if standalone_mode:
sys.exit(e.exit_code)
else:
# in non-standalone mode, return the exit code
# note that this is only reached if `self.invoke` above raises
# an Exit explicitly -- thus bypassing the check there which
# would return its result
# the results of non-standalone execution may therefore be
# somewhat ambiguous: if there are codepaths which lead to
# `ctx.exit(1)` and to `return 1`, the caller won't be able to
# tell the difference between the two
return e.exit_code
except Abort:
if not standalone_mode:
raise
echo(_("Aborted!"), file=sys.stderr)
/usr/lib/python3/dist-packages/click/core.py:1478: SystemExit
----------------------------- Captured stdout call -----------------------------
1
^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1435:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/click/core.py:1902: in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1900: in invoke
sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1245: in make_context
self.parse_args(ctx, args)
/usr/lib/python3/dist-packages/click/core.py:1256: in parse_args
_, args = param.handle_parse_result(ctx, opts, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:2583: in handle_parse_result
value, source = self.consume_value(ctx, opts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:3354: in consume_value
value = self.prompt_for_value(ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:3215: in prompt_for_value
return prompt(
/usr/lib/python3/dist-packages/click/termui.py:179: in prompt
value = prompt_func(prompt)
^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
text = 'Hostname [vs-test-like]: '
def prompt_func(text: str) -> str:
f = hidden_prompt_func if hide_input else visible_prompt_func
try:
# Write the prompt separately so that we get nice
# coloring through colorama on Windows
echo(text[:-1], nl=False, err=err)
# Echo the last character to stdout to work around an issue where
# readline causes backspace to clear the whole line.
return f(text[-1:])
except (KeyboardInterrupt, EOFError):
# getpass doesn't print a newline if the user aborts input with ^C.
# Allegedly this behavior is inherited from getpass(3).
# A doc bug has been filed at https://bugs.python.org/issue24711
if hide_input:
echo(None, err=err)
E click.exceptions.Abort
/usr/lib/python3/dist-packages/click/termui.py:162: Abort
During handling of the above exception, another exception occurred:
self = <tests.CLI.modules.vs.vs_create_tests.VirtCreateTests testMethod=test_create_like_tags>
confirm_mock = <MagicMock name='confirm' id='140113372918656'>
@mock.patch('SoftLayer.CLI.formatting.confirm')
def test_create_like_tags(self, confirm_mock):
mock = self.set_mock('SoftLayer_Virtual_Guest', 'getObject')
mock.return_value = {
'hostname': 'vs-test-like',
'domain': 'test.sftlyr.ws',
'maxCpu': 2,
'maxMemory': 1024,
'datacenter': {'name': 'dal05'},
'networkComponents': [{'maxSpeed': 100}],
'dedicatedAccountHostOnlyFlag': False,
'privateNetworkOnlyFlag': False,
'billingItem': {'orderItem': {'preset': {}}},
'operatingSystem': {'softwareLicense': {
'softwareDescription': {'referenceCode': 'UBUNTU_LATEST'}
}},
'hourlyBillingFlag': False,
'localDiskFlag': True,
'userData': {},
'tagReferences': [{'tag': {'name': 'production'}}],
}
confirm_mock.return_value = True
result = self.run_command(['vs', 'create',
'--like=123',
'--san',
'--billing=hourly'])
tests/CLI/modules/vs/vs_create_tests.py:434:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/SoftLayer/testing/__init__.py:159: in assert_no_fail
raise result.exception
/usr/lib/python3/dist-packages/click/testing.py:596: in invoke
return_value = cli.main(args=args or (), prog_name=prog_name, **extra)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <CommandLoader cli>
args = ['vs', 'create', '--like=123', '--san', '--billing=hourly']
prog_name = 'cli', complete_var = None, standalone_mode = True
windows_expand_args = True
extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebcac50>}
def main(
self,
args: cabc.Sequence[str] | None = None,
prog_name: str | None = None,
complete_var: str | None = None,
standalone_mode: bool = True,
windows_expand_args: bool = True,
**extra: t.Any,
) -> t.Any:
"""This is the way to invoke a script with all the bells and
whistles as a command line application. This will always terminate
the application after a call. If this is not wanted, ``SystemExit``
needs to be caught.
This method is also available by directly calling the instance of
a :class:`Command`.
:param args: the arguments that should be used for parsing. If not
provided, ``sys.argv[1:]`` is used.
:param prog_name: the program name that should be used. By default
the program name is constructed by taking the file
name from ``sys.argv[0]``.
:param complete_var: the environment variable that controls the
bash completion support. The default is
``"_<prog_name>_COMPLETE"`` with prog_name in
uppercase.
:param standalone_mode: the default behavior is to invoke the script
in standalone mode. Click will then
handle exceptions and convert them into
error messages and the function will never
return but shut down the interpreter. If
this is set to `False` they will be
propagated to the caller and the return
value of this function is the return value
of :meth:`invoke`.
:param windows_expand_args: Expand glob patterns, user dir, and
env vars in command line args on Windows.
:param extra: extra keyword arguments are forwarded to the context
constructor. See :class:`Context` for more information.
.. versionchanged:: 8.0.1
Added the ``windows_expand_args`` parameter to allow
disabling command line arg expansion on Windows.
.. versionchanged:: 8.0
When taking arguments from ``sys.argv`` on Windows, glob
patterns, user dir, and env vars are expanded.
.. versionchanged:: 3.0
Added the ``standalone_mode`` parameter.
"""
if args is None:
args = sys.argv[1:]
if os.name == "nt" and windows_expand_args:
args = _expand_args(args)
else:
args = list(args)
if prog_name is None:
prog_name = _detect_program_name()
# Process shell completion requests and exit early.
self._main_shell_completion(extra, prog_name, complete_var)
try:
try:
with self.make_context(prog_name, args, **extra) as ctx:
rv = self.invoke(ctx)
if not standalone_mode:
return rv
# it's not safe to `ctx.exit(rv)` here!
# note that `rv` may actually contain data like "1" which
# has obvious effects
# more subtle case: `rv=[None, None]` can come out of
# chained commands which all returned `None` -- so it's not
# even always obvious that `rv` indicates success/failure
# by its truthiness/falsiness
ctx.exit()
except (EOFError, KeyboardInterrupt) as e:
echo(file=sys.stderr)
raise Abort() from e
except ClickException as e:
if not standalone_mode:
raise
e.show()
sys.exit(e.exit_code)
except OSError as e:
if e.errno == errno.EPIPE:
sys.stdout = t.cast(t.TextIO, PacifyFlushWrapper(sys.stdout))
sys.stderr = t.cast(t.TextIO, PacifyFlushWrapper(sys.stderr))
sys.exit(1)
else:
raise
except Exit as e:
if standalone_mode:
sys.exit(e.exit_code)
else:
# in non-standalone mode, return the exit code
# note that this is only reached if `self.invoke` above raises
# an Exit explicitly -- thus bypassing the check there which
# would return its result
# the results of non-standalone execution may therefore be
# somewhat ambiguous: if there are codepaths which lead to
# `ctx.exit(1)` and to `return 1`, the caller won't be able to
# tell the difference between the two
return e.exit_code
except Abort:
if not standalone_mode:
raise
echo(_("Aborted!"), file=sys.stderr)
/usr/lib/python3/dist-packages/click/core.py:1478: SystemExit
----------------------------- Captured stdout call -----------------------------
1
^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1435:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/click/core.py:1902: in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1900: in invoke
sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:1245: in make_context
self.parse_args(ctx, args)
/usr/lib/python3/dist-packages/click/core.py:1256: in parse_args
_, args = param.handle_parse_result(ctx, opts, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:2583: in handle_parse_result
value, source = self.consume_value(ctx, opts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:3354: in consume_value
value = self.prompt_for_value(ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/click/core.py:3215: in prompt_for_value
return prompt(
/usr/lib/python3/dist-packages/click/termui.py:179: in prompt
value = prompt_func(prompt)
^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
text = 'Hostname [vs-test-like]: '
def prompt_func(text: str) -> str:
f = hidden_prompt_func if hide_input else visible_prompt_func
try:
# Write the prompt separately so that we get nice
# coloring through colorama on Windows
echo(text[:-1], nl=False, err=err)
# Echo the last character to stdout to work around an issue where
# readline causes backspace to clear the whole line.
return f(text[-1:])
except (KeyboardInterrupt, EOFError):
# getpass doesn't print a newline if the user aborts input with ^C.
# Allegedly this behavior is inherited from getpass(3).
# A doc bug has been filed at https://bugs.python.org/issue24711
if hide_input:
echo(None, err=err)
E click.exceptions.Abort
/usr/lib/python3/dist-packages/click/termui.py:162: Abort
During handling of the above exception, another exception occurred:
self = <tests.CLI.modules.vs.vs_create_tests.VirtCreateTests testMethod=test_create_like_transient>
confirm_mock = <MagicMock name='confirm' id='140113450990096'>
@mock.patch('SoftLayer.CLI.formatting.confirm')
def test_create_like_transient(self, confirm_mock):
mock = self.set_mock('SoftLayer_Virtual_Guest', 'getObject')
mock.return_value = {
'hostname': 'vs-test-like',
'domain': 'test.sftlyr.ws',
'datacenter': {'name': 'dal05'},
'networkComponents': [{'maxSpeed': 100}],
'dedicatedAccountHostOnlyFlag': False,
'privateNetworkOnlyFlag': False,
'billingItem': {'orderItem': {'preset': {'keyName': 'B1_1X2X25'}}},
'operatingSystem': {'softwareLicense': {
'softwareDescription': {'referenceCode': 'UBUNTU_LATEST'}
}},
'hourlyBillingFlag': True,
'localDiskFlag': False,
'transientGuestFlag': True,
'userData': {}
}
confirm_mock.return_value = True
result = self.run_command(['vs', 'create', '--like=123'])
tests/CLI/modules/vs/vs_create_tests.py:545:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/SoftLayer/testing/__init__.py:159: in assert_no_fail
raise result.exception
/usr/lib/python3/dist-packages/click/testing.py:596: in invoke
return_value = cli.main(args=args or (), prog_name=prog_name, **extra)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <CommandLoader cli>, args = ['vs', 'create', '--like=123']
prog_name = 'cli', complete_var = None, standalone_mode = True
windows_expand_args = True
extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebcaf10>}
def main(
self,
args: cabc.Sequence[str] | None = None,
prog_name: str | None = None,
complete_var: str | None = None,
standalone_mode: bool = True,
windows_expand_args: bool = True,
**extra: t.Any,
) -> t.Any:
"""This is the way to invoke a script with all the bells and
whistles as a command line application. This will always terminate
the application after a call. If this is not wanted, ``SystemExit``
needs to be caught.
This method is also available by directly calling the instance of
a :class:`Command`.
:param args: the arguments that should be used for parsing. If not
provided, ``sys.argv[1:]`` is used.
:param prog_name: the program name that should be used. By default
the program name is constructed by taking the file
name from ``sys.argv[0]``.
:param complete_var: the environment variable that controls the
bash completion support. The default is
``"_<prog_name>_COMPLETE"`` with prog_name in
uppercase.
:param standalone_mode: the default behavior is to invoke the script
in standalone mode. Click will then
handle exceptions and convert them into
error messages and the function will never
return but shut down the interpreter. If
this is set to `False` they will be
propagated to the caller and the return
value of this function is the return value
of :meth:`invoke`.
:param windows_expand_args: Expand glob patterns, user dir, and
env vars in command line args on Windows.
:param extra: extra keyword arguments are forwarded to the context
constructor. See :class:`Context` for more information.
.. versionchanged:: 8.0.1
Added the ``windows_expand_args`` parameter to allow
disabling command line arg expansion on Windows.
.. versionchanged:: 8.0
When taking arguments from ``sys.argv`` on Windows, glob
patterns, user dir, and env vars are expanded.
.. versionchanged:: 3.0
Added the ``standalone_mode`` parameter.
"""
if args is None:
args = sys.argv[1:]
if os.name == "nt" and windows_expand_args:
args = _expand_args(args)
else:
args = list(args)
if prog_name is None:
prog_name = _detect_program_name()
# Process shell completion requests and exit early.
self._main_shell_completion(extra, prog_name, complete_var)
try:
try:
with self.make_context(prog_name, args, **extra) as ctx:
rv = self.invoke(ctx)
if not standalone_mode:
return rv
# it's not safe to `ctx.exit(rv)` here!
# note that `rv` may actually contain data like "1" which
# has obvious effects
# more subtle case: `rv=[None, None]` can come out of
# chained commands which all returned `None` -- so it's not
# even always obvious that `rv` indicates success/failure
# by its truthiness/falsiness
ctx.exit()
except (EOFError, KeyboardInterrupt) as e:
echo(file=sys.stderr)
raise Abort() from e
except ClickException as e:
if not standalone_mode:
raise
e.show()
sys.exit(e.exit_code)
except OSError as e:
if e.errno == errno.EPIPE:
sys.stdout = t.cast(t.TextIO, PacifyFlushWrapper(sys.stdout))
sys.stderr = t.cast(t.TextIO, PacifyFlushWrapper(sys.stderr))
sys.exit(1)
else:
raise
except Exit as e:
if standalone_mode:
sys.exit(e.exit_code)
else:
# in non-standalone mode, return the exit code
# note that this is only reached if `self.invoke` above raises
# an Exit explicitly -- thus bypassing the check there which
# would return its result
# the results of non-standalone execution may therefore be
# somewhat ambiguous: if there are codepaths which lead to
# `ctx.exit(1)` and to `return 1`, the caller won't be able to
# tell the difference between the two
return e.exit_code
except Abort:
if not standalone_mode:
raise
echo(_("Aborted!"), file=sys.stderr)
/usr/lib/python3/dist-packages/click/core.py:1478: SystemExit
----------------------------- Captured stdout call -----------------------------
1
tests/managers/block_tests.py:290: AssertionError
=============================== warnings summary ===============================
tests/CLI/core_tests.py::CoreTests::test_build_client
tests/CLI/core_tests.py::CoreTests::test_diagnostics
tests/CLI/core_tests.py::CoreTests::test_load_all
tests/CLI/core_tests.py::CoreTests::test_verbose_max
tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs
tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs_search_args
tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs_search_noargs
tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs_search_noargs_domain
/usr/lib/python3/dist-packages/click/core.py:1252: UserWarning: The parameter --tag is used more than once. Remove its duplicate as parameters should be unique.
parser = self.make_parser(ctx)
tests/CLI/core_tests.py::CoreTests::test_build_client
tests/CLI/core_tests.py::CoreTests::test_diagnostics
tests/CLI/core_tests.py::CoreTests::test_load_all
tests/CLI/core_tests.py::CoreTests::test_verbose_max
tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs
tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs_search_args
tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs_search_noargs
tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs_search_noargs_domain
/usr/lib/python3/dist-packages/click/core.py:1245: UserWarning: The parameter --tag is used more than once. Remove its duplicate as parameters should be unique.
self.parse_args(ctx, args)
tests/CLI/core_tests.py::CoreTests::test_load_all
/usr/lib/python3/dist-packages/SoftLayer/CLI/command.py:177: UserWarning: The parameter --tag is used more than once. Remove its duplicate as parameters should be unique.
pieces = self.collect_usage_pieces(ctx)
tests/CLI/core_tests.py::CoreTests::test_load_all
/usr/lib/python3/dist-packages/click/core.py:1163: UserWarning: The parameter --tag is used more than once. Remove its duplicate as parameters should be unique.
self.format_options(ctx, formatter)