-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
$ pixi run test
✨ Pixi task (test in test-py312): python -mpytest -vvv
============================= test session starts ==============================
platform darwin -- Python 3.12.8, pytest-7.4.3, pluggy-1.5.0 -- /Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/bin/python
cachedir: .pytest_cache
rootdir: /Users/ondrej/repos/conda-spawn
plugins: mock-3.12.0
collected 14 items
tests/test_cli.py::test_cli FAILED [ 7%]
tests/test_cli.py::test_nesting_disallowed FAILED [ 14%]
tests/test_cli.py::test_nesting_replace FAILED [ 21%]
tests/test_cli.py::test_nesting_stack FAILED [ 28%]
tests/test_shell.py::test_posix_shell Channels:
- conda-forge
Platform: osx-arm64
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
## Package Plan ##
environment location: /private/var/folders/vg/lymvsp1153sgwwfdh3pm45hw0000gn/T/pytest-of-ondrej/pytest-0/tmp_env-0
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
PASSED [ 35%]
tests/test_shell.py::test_powershell SKIPPED (Powershell only tested on
Windows) [ 42%]
tests/test_shell.py::test_cmd SKIPPED (Cmd.exe only tested on Windows) [ 50%]
tests/test_shell.py::test_hooks FAILED [ 57%]
tests/test_shell.py::test_hooks_integration_posix FAILED [ 64%]
tests/test_shell.py::test_hooks_integration_powershell SKIPPED [ 71%]
tests/test_shell.py::test_hooks_integration_cmd SKIPPED (Cmd.exe only
tested on Windows) [ 78%]
tests/test_shell.py::test_condabin_first_posix_shell FAILED [ 85%]
tests/test_shell.py::test_condabin_first_powershell SKIPPED (Powershell
only tested on Windows) [ 92%]
tests/test_shell.py::test_condabin_first_cmd SKIPPED (Cmd.exe only
tested on Windows) [100%]
=================================== FAILURES ===================================
___________________________________ test_cli ___________________________________
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x105877080>
conda_cli = CondaCLIFixture(capsys=<_pytest.capture.CaptureFixture object at 0x105877230>)
def test_cli(monkeypatch, conda_cli):
monkeypatch.setattr(sys, "argv", ["conda", *sys.argv[1:]])
out, err, _ = conda_cli("spawn", "-h", raises=SystemExit)
> assert not err
E assert not "usage: conda [-h] [-v] [--no-plugins] [-V] COMMAND ...\nconda: error: argument COMMAND: invalid choice: 'spawn' (choose from activate, clean, commands, compare, config, create, deactivate, env, export, info, init, install, list, notices, package, build, convert, debug, develop, doctor, index, inspect, metapackage, render, repoquery, skeleton, remove, uninstall, rename, run, search, update, upgrade)\n"
tests/test_cli.py:9: AssertionError
___________________________ test_nesting_disallowed ____________________________
self = ArgumentParser(prog='__main__.py', usage=None, description='conda is a tool for managing and deploying applications, e...d packages.', formatter_class=<class 'argparse.RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)
args = ['spawn', '-p', '/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312', '--hook']
namespace = Namespace(verbosity=<conda.auxlib._Null object at 0x102e0fa70>, debug=<conda.auxlib._Null object at 0x102e0fa70>, trac...a70>, json=<conda.auxlib._Null object at 0x102e0fa70>, no_plugins=<conda.auxlib._Null object at 0x102e0fa70>, cmd=None)
intermixed = False
def _parse_known_args2(self, args, namespace, intermixed):
if args is None:
# args default to the system args
args = _sys.argv[1:]
else:
# make sure that args are mutable
args = list(args)
# default Namespace built from parser defaults
if namespace is None:
namespace = Namespace()
# add any action defaults that aren't present
for action in self._actions:
if action.dest is not SUPPRESS:
if not hasattr(namespace, action.dest):
if action.default is not SUPPRESS:
setattr(namespace, action.dest, action.default)
# add any parser defaults that aren't present
for dest in self._defaults:
if not hasattr(namespace, dest):
setattr(namespace, dest, self._defaults[dest])
# parse the arguments and exit if there are any errors
if self.exit_on_error:
try:
> namespace, args = self._parse_known_args(args, namespace, intermixed)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1943:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi/envs/test-py312/lib/python3.12/argparse.py:2165: in _parse_known_args
positionals_end_index = consume_positionals(start_index)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2141: in consume_positionals
take_action(action, args)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2003: in take_action
argument_values = self._get_values(action, argument_strings)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2523: in _get_values
self._check_value(action, value[0])
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/cli/conda_argparse.py:230: in _check_value
super()._check_value(action, value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ArgumentParser(prog='__main__.py', usage=None, description='conda is a tool for managing and deploying applications, e...d packages.', formatter_class=<class 'argparse.RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)
action = _GreedySubParsersAction(option_strings=[], dest='cmd', nargs='A...', const=None, default=None, type=None, choices={'ac...RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)}, required=True, help=None, metavar='COMMAND')
value = 'spawn'
def _check_value(self, action, value):
# converted value must be one of the choices (if specified)
choices = action.choices
if choices is not None:
if isinstance(choices, str):
choices = iter(choices)
if value not in choices:
args = {'value': str(value),
'choices': ', '.join(map(str, action.choices))}
msg = _('invalid choice: %(value)r (choose from %(choices)s)')
> raise ArgumentError(action, msg % args)
E argparse.ArgumentError: argument COMMAND: invalid choice: 'spawn' (choose from activate, clean, commands, compare, config, create, deactivate, env, export, info, init, install, list, notices, package, build, convert, debug, develop, doctor, index, inspect, metapackage, render, repoquery, skeleton, remove, uninstall, rename, run, search, update, upgrade)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2573: ArgumentError
During handling of the above exception, another exception occurred:
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x105877260>
conda_cli = CondaCLIFixture(capsys=<_pytest.capture.CaptureFixture object at 0x1062fe090>)
def test_nesting_disallowed(monkeypatch, conda_cli):
monkeypatch.setenv("CONDA_SPAWN", "1")
> conda_cli("spawn", "-p", sys.prefix, "--hook", raises=CondaError)
tests/test_cli.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/testing/fixtures.py:236: in __call__
code = main_subshell(*argv)
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/cli/main.py:52: in main_subshell
args = parser.parse_args(args, override_args=override_args, namespace=pre_args)
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/cli/conda_argparse.py:233: in parse_args
parsed_args = super().parse_args(*args, **kwargs)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1904: in parse_args
args, argv = self.parse_known_args(args, namespace)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1914: in parse_known_args
return self._parse_known_args2(args, namespace, intermixed=False)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1945: in _parse_known_args2
self.error(str(err))
.pixi/envs/test-py312/lib/python3.12/argparse.py:2650: in error
self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ArgumentParser(prog='__main__.py', usage=None, description='conda is a tool for managing and deploying applications, e...d packages.', formatter_class=<class 'argparse.RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)
status = 2
message = "__main__.py: error: argument COMMAND: invalid choice: 'spawn' (choose from activate, clean, commands, compare, config..., index, inspect, metapackage, render, repoquery, skeleton, remove, uninstall, rename, run, search, update, upgrade)\n"
def exit(self, status=0, message=None):
if message:
self._print_message(message, _sys.stderr)
> _sys.exit(status)
E SystemExit: 2
.pixi/envs/test-py312/lib/python3.12/argparse.py:2637: SystemExit
----------------------------- Captured stderr call -----------------------------
usage: __main__.py [-h] [-v] [--no-plugins] [-V] COMMAND ...
__main__.py: error: argument COMMAND: invalid choice: 'spawn' (choose from activate, clean, commands, compare, config, create, deactivate, env, export, info, init, install, list, notices, package, build, convert, debug, develop, doctor, index, inspect, metapackage, render, repoquery, skeleton, remove, uninstall, rename, run, search, update, upgrade)
_____________________________ test_nesting_replace _____________________________
self = ArgumentParser(prog='__main__.py', usage=None, description='conda is a tool for managing and deploying applications, e...d packages.', formatter_class=<class 'argparse.RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)
args = ['spawn', '-p', '/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312', '--hook', '--replace']
namespace = Namespace(verbosity=<conda.auxlib._Null object at 0x102e0fa70>, debug=<conda.auxlib._Null object at 0x102e0fa70>, trac...a70>, json=<conda.auxlib._Null object at 0x102e0fa70>, no_plugins=<conda.auxlib._Null object at 0x102e0fa70>, cmd=None)
intermixed = False
def _parse_known_args2(self, args, namespace, intermixed):
if args is None:
# args default to the system args
args = _sys.argv[1:]
else:
# make sure that args are mutable
args = list(args)
# default Namespace built from parser defaults
if namespace is None:
namespace = Namespace()
# add any action defaults that aren't present
for action in self._actions:
if action.dest is not SUPPRESS:
if not hasattr(namespace, action.dest):
if action.default is not SUPPRESS:
setattr(namespace, action.dest, action.default)
# add any parser defaults that aren't present
for dest in self._defaults:
if not hasattr(namespace, dest):
setattr(namespace, dest, self._defaults[dest])
# parse the arguments and exit if there are any errors
if self.exit_on_error:
try:
> namespace, args = self._parse_known_args(args, namespace, intermixed)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1943:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi/envs/test-py312/lib/python3.12/argparse.py:2165: in _parse_known_args
positionals_end_index = consume_positionals(start_index)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2141: in consume_positionals
take_action(action, args)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2003: in take_action
argument_values = self._get_values(action, argument_strings)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2523: in _get_values
self._check_value(action, value[0])
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/cli/conda_argparse.py:230: in _check_value
super()._check_value(action, value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ArgumentParser(prog='__main__.py', usage=None, description='conda is a tool for managing and deploying applications, e...d packages.', formatter_class=<class 'argparse.RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)
action = _GreedySubParsersAction(option_strings=[], dest='cmd', nargs='A...', const=None, default=None, type=None, choices={'ac...RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)}, required=True, help=None, metavar='COMMAND')
value = 'spawn'
def _check_value(self, action, value):
# converted value must be one of the choices (if specified)
choices = action.choices
if choices is not None:
if isinstance(choices, str):
choices = iter(choices)
if value not in choices:
args = {'value': str(value),
'choices': ', '.join(map(str, action.choices))}
msg = _('invalid choice: %(value)r (choose from %(choices)s)')
> raise ArgumentError(action, msg % args)
E argparse.ArgumentError: argument COMMAND: invalid choice: 'spawn' (choose from activate, clean, commands, compare, config, create, deactivate, env, export, info, init, install, list, notices, package, build, convert, debug, develop, doctor, index, inspect, metapackage, render, repoquery, skeleton, remove, uninstall, rename, run, search, update, upgrade)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2573: ArgumentError
During handling of the above exception, another exception occurred:
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x10624c8f0>
conda_cli = CondaCLIFixture(capsys=<_pytest.capture.CaptureFixture object at 0x1062fe780>)
def test_nesting_replace(monkeypatch, conda_cli):
monkeypatch.setenv("CONDA_SPAWN", "1")
> out, err, rc = conda_cli("spawn", "-p", sys.prefix, "--hook", "--replace")
tests/test_cli.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/testing/fixtures.py:236: in __call__
code = main_subshell(*argv)
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/cli/main.py:52: in main_subshell
args = parser.parse_args(args, override_args=override_args, namespace=pre_args)
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/cli/conda_argparse.py:233: in parse_args
parsed_args = super().parse_args(*args, **kwargs)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1904: in parse_args
args, argv = self.parse_known_args(args, namespace)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1914: in parse_known_args
return self._parse_known_args2(args, namespace, intermixed=False)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1945: in _parse_known_args2
self.error(str(err))
.pixi/envs/test-py312/lib/python3.12/argparse.py:2650: in error
self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ArgumentParser(prog='__main__.py', usage=None, description='conda is a tool for managing and deploying applications, e...d packages.', formatter_class=<class 'argparse.RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)
status = 2
message = "__main__.py: error: argument COMMAND: invalid choice: 'spawn' (choose from activate, clean, commands, compare, config..., index, inspect, metapackage, render, repoquery, skeleton, remove, uninstall, rename, run, search, update, upgrade)\n"
def exit(self, status=0, message=None):
if message:
self._print_message(message, _sys.stderr)
> _sys.exit(status)
E SystemExit: 2
.pixi/envs/test-py312/lib/python3.12/argparse.py:2637: SystemExit
----------------------------- Captured stderr call -----------------------------
usage: __main__.py [-h] [-v] [--no-plugins] [-V] COMMAND ...
__main__.py: error: argument COMMAND: invalid choice: 'spawn' (choose from activate, clean, commands, compare, config, create, deactivate, env, export, info, init, install, list, notices, package, build, convert, debug, develop, doctor, index, inspect, metapackage, render, repoquery, skeleton, remove, uninstall, rename, run, search, update, upgrade)
______________________________ test_nesting_stack ______________________________
self = ArgumentParser(prog='__main__.py', usage=None, description='conda is a tool for managing and deploying applications, e...d packages.', formatter_class=<class 'argparse.RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)
args = ['spawn', '-p', '/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312', '--hook', '--stack']
namespace = Namespace(verbosity=<conda.auxlib._Null object at 0x102e0fa70>, debug=<conda.auxlib._Null object at 0x102e0fa70>, trac...a70>, json=<conda.auxlib._Null object at 0x102e0fa70>, no_plugins=<conda.auxlib._Null object at 0x102e0fa70>, cmd=None)
intermixed = False
def _parse_known_args2(self, args, namespace, intermixed):
if args is None:
# args default to the system args
args = _sys.argv[1:]
else:
# make sure that args are mutable
args = list(args)
# default Namespace built from parser defaults
if namespace is None:
namespace = Namespace()
# add any action defaults that aren't present
for action in self._actions:
if action.dest is not SUPPRESS:
if not hasattr(namespace, action.dest):
if action.default is not SUPPRESS:
setattr(namespace, action.dest, action.default)
# add any parser defaults that aren't present
for dest in self._defaults:
if not hasattr(namespace, dest):
setattr(namespace, dest, self._defaults[dest])
# parse the arguments and exit if there are any errors
if self.exit_on_error:
try:
> namespace, args = self._parse_known_args(args, namespace, intermixed)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1943:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi/envs/test-py312/lib/python3.12/argparse.py:2165: in _parse_known_args
positionals_end_index = consume_positionals(start_index)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2141: in consume_positionals
take_action(action, args)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2003: in take_action
argument_values = self._get_values(action, argument_strings)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2523: in _get_values
self._check_value(action, value[0])
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/cli/conda_argparse.py:230: in _check_value
super()._check_value(action, value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ArgumentParser(prog='__main__.py', usage=None, description='conda is a tool for managing and deploying applications, e...d packages.', formatter_class=<class 'argparse.RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)
action = _GreedySubParsersAction(option_strings=[], dest='cmd', nargs='A...', const=None, default=None, type=None, choices={'ac...RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)}, required=True, help=None, metavar='COMMAND')
value = 'spawn'
def _check_value(self, action, value):
# converted value must be one of the choices (if specified)
choices = action.choices
if choices is not None:
if isinstance(choices, str):
choices = iter(choices)
if value not in choices:
args = {'value': str(value),
'choices': ', '.join(map(str, action.choices))}
msg = _('invalid choice: %(value)r (choose from %(choices)s)')
> raise ArgumentError(action, msg % args)
E argparse.ArgumentError: argument COMMAND: invalid choice: 'spawn' (choose from activate, clean, commands, compare, config, create, deactivate, env, export, info, init, install, list, notices, package, build, convert, debug, develop, doctor, index, inspect, metapackage, render, repoquery, skeleton, remove, uninstall, rename, run, search, update, upgrade)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2573: ArgumentError
During handling of the above exception, another exception occurred:
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x106af5190>
conda_cli = CondaCLIFixture(capsys=<_pytest.capture.CaptureFixture object at 0x106af52e0>)
def test_nesting_stack(monkeypatch, conda_cli):
monkeypatch.setenv("CONDA_SPAWN", "1")
> out, err, rc = conda_cli("spawn", "-p", sys.prefix, "--hook", "--stack")
tests/test_cli.py:28:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/testing/fixtures.py:236: in __call__
code = main_subshell(*argv)
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/cli/main.py:52: in main_subshell
args = parser.parse_args(args, override_args=override_args, namespace=pre_args)
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/cli/conda_argparse.py:233: in parse_args
parsed_args = super().parse_args(*args, **kwargs)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1904: in parse_args
args, argv = self.parse_known_args(args, namespace)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1914: in parse_known_args
return self._parse_known_args2(args, namespace, intermixed=False)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1945: in _parse_known_args2
self.error(str(err))
.pixi/envs/test-py312/lib/python3.12/argparse.py:2650: in error
self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ArgumentParser(prog='__main__.py', usage=None, description='conda is a tool for managing and deploying applications, e...d packages.', formatter_class=<class 'argparse.RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)
status = 2
message = "__main__.py: error: argument COMMAND: invalid choice: 'spawn' (choose from activate, clean, commands, compare, config..., index, inspect, metapackage, render, repoquery, skeleton, remove, uninstall, rename, run, search, update, upgrade)\n"
def exit(self, status=0, message=None):
if message:
self._print_message(message, _sys.stderr)
> _sys.exit(status)
E SystemExit: 2
.pixi/envs/test-py312/lib/python3.12/argparse.py:2637: SystemExit
----------------------------- Captured stderr call -----------------------------
usage: __main__.py [-h] [-v] [--no-plugins] [-V] COMMAND ...
__main__.py: error: argument COMMAND: invalid choice: 'spawn' (choose from activate, clean, commands, compare, config, create, deactivate, env, export, info, init, install, list, notices, package, build, convert, debug, develop, doctor, index, inspect, metapackage, render, repoquery, skeleton, remove, uninstall, rename, run, search, update, upgrade)
__________________________________ test_hooks __________________________________
self = ArgumentParser(prog='__main__.py', usage=None, description='conda is a tool for managing and deploying applications, e...d packages.', formatter_class=<class 'argparse.RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)
args = ['spawn', '--hook', '-p', '/private/var/folders/vg/lymvsp1153sgwwfdh3pm45hw0000gn/T/pytest-of-ondrej/pytest-0/tmp_env-0']
namespace = Namespace(verbosity=<conda.auxlib._Null object at 0x102e0fa70>, debug=<conda.auxlib._Null object at 0x102e0fa70>, trac...a70>, json=<conda.auxlib._Null object at 0x102e0fa70>, no_plugins=<conda.auxlib._Null object at 0x102e0fa70>, cmd=None)
intermixed = False
def _parse_known_args2(self, args, namespace, intermixed):
if args is None:
# args default to the system args
args = _sys.argv[1:]
else:
# make sure that args are mutable
args = list(args)
# default Namespace built from parser defaults
if namespace is None:
namespace = Namespace()
# add any action defaults that aren't present
for action in self._actions:
if action.dest is not SUPPRESS:
if not hasattr(namespace, action.dest):
if action.default is not SUPPRESS:
setattr(namespace, action.dest, action.default)
# add any parser defaults that aren't present
for dest in self._defaults:
if not hasattr(namespace, dest):
setattr(namespace, dest, self._defaults[dest])
# parse the arguments and exit if there are any errors
if self.exit_on_error:
try:
> namespace, args = self._parse_known_args(args, namespace, intermixed)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1943:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi/envs/test-py312/lib/python3.12/argparse.py:2165: in _parse_known_args
positionals_end_index = consume_positionals(start_index)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2141: in consume_positionals
take_action(action, args)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2003: in take_action
argument_values = self._get_values(action, argument_strings)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2523: in _get_values
self._check_value(action, value[0])
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/cli/conda_argparse.py:230: in _check_value
super()._check_value(action, value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ArgumentParser(prog='__main__.py', usage=None, description='conda is a tool for managing and deploying applications, e...d packages.', formatter_class=<class 'argparse.RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)
action = _GreedySubParsersAction(option_strings=[], dest='cmd', nargs='A...', const=None, default=None, type=None, choices={'ac...RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)}, required=True, help=None, metavar='COMMAND')
value = 'spawn'
def _check_value(self, action, value):
# converted value must be one of the choices (if specified)
choices = action.choices
if choices is not None:
if isinstance(choices, str):
choices = iter(choices)
if value not in choices:
args = {'value': str(value),
'choices': ', '.join(map(str, action.choices))}
msg = _('invalid choice: %(value)r (choose from %(choices)s)')
> raise ArgumentError(action, msg % args)
E argparse.ArgumentError: argument COMMAND: invalid choice: 'spawn' (choose from activate, clean, commands, compare, config, create, deactivate, env, export, info, init, install, list, notices, package, build, convert, debug, develop, doctor, index, inspect, metapackage, render, repoquery, skeleton, remove, uninstall, rename, run, search, update, upgrade)
.pixi/envs/test-py312/lib/python3.12/argparse.py:2573: ArgumentError
During handling of the above exception, another exception occurred:
conda_cli = CondaCLIFixture(capsys=<_pytest.capture.CaptureFixture object at 0x106fef4d0>)
simple_env = PosixPath('/private/var/folders/vg/lymvsp1153sgwwfdh3pm45hw0000gn/T/pytest-of-ondrej/pytest-0/tmp_env-0')
def test_hooks(conda_cli, simple_env):
> out, err, rc = conda_cli("spawn", "--hook", "-p", simple_env)
tests/test_shell.py:67:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/testing/fixtures.py:236: in __call__
code = main_subshell(*argv)
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/cli/main.py:52: in main_subshell
args = parser.parse_args(args, override_args=override_args, namespace=pre_args)
.pixi/envs/test-py312/lib/python3.12/site-packages/conda/cli/conda_argparse.py:233: in parse_args
parsed_args = super().parse_args(*args, **kwargs)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1904: in parse_args
args, argv = self.parse_known_args(args, namespace)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1914: in parse_known_args
return self._parse_known_args2(args, namespace, intermixed=False)
.pixi/envs/test-py312/lib/python3.12/argparse.py:1945: in _parse_known_args2
self.error(str(err))
.pixi/envs/test-py312/lib/python3.12/argparse.py:2650: in error
self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ArgumentParser(prog='__main__.py', usage=None, description='conda is a tool for managing and deploying applications, e...d packages.', formatter_class=<class 'argparse.RawDescriptionHelpFormatter'>, conflict_handler='error', add_help=False)
status = 2
message = "__main__.py: error: argument COMMAND: invalid choice: 'spawn' (choose from activate, clean, commands, compare, config..., index, inspect, metapackage, render, repoquery, skeleton, remove, uninstall, rename, run, search, update, upgrade)\n"
def exit(self, status=0, message=None):
if message:
self._print_message(message, _sys.stderr)
> _sys.exit(status)
E SystemExit: 2
.pixi/envs/test-py312/lib/python3.12/argparse.py:2637: SystemExit
----------------------------- Captured stderr call -----------------------------
usage: __main__.py [-h] [-v] [--no-plugins] [-V] COMMAND ...
__main__.py: error: argument COMMAND: invalid choice: 'spawn' (choose from activate, clean, commands, compare, config, create, deactivate, env, export, info, init, install, list, notices, package, build, convert, debug, develop, doctor, index, inspect, metapackage, render, repoquery, skeleton, remove, uninstall, rename, run, search, update, upgrade)
_________________________ test_hooks_integration_posix _________________________
simple_env = PosixPath('/private/var/folders/vg/lymvsp1153sgwwfdh3pm45hw0000gn/T/pytest-of-ondrej/pytest-0/tmp_env-0')
tmp_path = PosixPath('/private/var/folders/vg/lymvsp1153sgwwfdh3pm45hw0000gn/T/pytest-of-ondrej/pytest-0/test_hooks_integration_posix0')
@pytest.mark.skipif(sys.platform == "win32", reason="Only tested on Unix")
def test_hooks_integration_posix(simple_env, tmp_path):
hook = f"{sys.executable} -m conda spawn --hook --shell posix -p '{simple_env}'"
script = f'eval "$({hook})"\nenv | sort'
script_path = tmp_path / "script-eval.sh"
script_path.write_text(script)
out = check_output(["bash", script_path], text=True)
print(out)
> assert str(simple_env) in out
E AssertionError: assert '/private/var/folders/vg/lymvsp1153sgwwfdh3pm45hw0000gn/T/pytest-of-ondrej/pytest-0/tmp_env-0' in 'CLICOLOR=1\nCONDA_ALLOW_SOFTLINKS=false\nCONDA_DEFAULT_ENV=conda-spawn:test-py312\nCONDA_EXE=/Users/ondrej/miniforge3/bin/conda\nCONDA_PREFIX=/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312\nCONDA_PYTHON_EXE=/Users/ondrej/miniforge3/bin/python\nCONDA_ROOT=/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312\nCONDA_SHLVL=0\nHOME=/Users/ondrej\nINIT_CWD=/Users/ondrej/repos/conda-spawn\nLANG=en_US.UTF-8\nLOGNAME=ondrej\nLaunchInstanceID=32E2787D-7A6E-407F-A89B-D9925AFA3564\nPATH=/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/bin:/Users/ondrej/miniforge3/condabin:/Users/ondrej/.pixi/bin:/Users/ondrej/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/ondrej/.cargo/bin:/Users/ondrej/.cache/lm-studio/bin\nPIXI_ENVIRONMENT_NAME=test-py312\nPIXI_ENVIRONMENT_PLATFORMS=win-64,osx-arm64,osx-64,linux-64\nPIXI_EXE=/Users/ondrej/.pixi/bin/pixi\nPIXI_IN_SHELL=1\nPIXI_PROJECT_MANIFEST=/Users/ondrej/repos/conda-spawn/pyproject.toml\nPIXI_PROJECT_NAME=conda-spawn\nPIXI_PROJECT_ROOT=/Users/ondrej/repos/conda-spawn\nPIXI_PROJECT_VERSION=NO_VERSION_SPECIFIED\nPIXI_PROMPT=(conda-spawn:test-py312) \nPWD=/Users/ondrej/repos/conda-spawn\nPYTEST_CURRENT_TEST=tests/test_shell.py::test_hooks_integration_posix (call)\nSECURITYSESSIONID=186ac\nSHELL=/bin/zsh\nSHLVL=2\nSSH_AUTH_SOCK=/private/tmp/com.apple.launchd.ahGPFv9VJs/Listeners\nTERM=xterm-256color\nTERM_PROGRAM=Apple_Terminal\nTERM_PROGRAM_VERSION=455\nTERM_SESSION_ID=EFF30468-FEAE-4F41-B83E-06B93969CE2C\nTMPDIR=/var/folders/vg/lymvsp1153sgwwfdh3pm45hw0000gn/T/\nUSER=ondrej\nXML_CATALOG_FILES=file:///Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/etc/xml/catalog file:///etc/xml/catalog\nXPC_FLAGS=0x0\nXPC_SERVICE_NAME=0\n_=/usr/bin/env\n_CE_CONDA=\n_CE_M=\n__CFBundleIdentifier=com.apple.Terminal\n__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0\n'
E + where '/private/var/folders/vg/lymvsp1153sgwwfdh3pm45hw0000gn/T/pytest-of-ondrej/pytest-0/tmp_env-0' = str(PosixPath('/private/var/folders/vg/lymvsp1153sgwwfdh3pm45hw0000gn/T/pytest-of-ondrej/pytest-0/tmp_env-0'))
tests/test_shell.py:85: AssertionError
----------------------------- Captured stdout call -----------------------------
CLICOLOR=1
CONDA_ALLOW_SOFTLINKS=false
CONDA_DEFAULT_ENV=conda-spawn:test-py312
CONDA_EXE=/Users/ondrej/miniforge3/bin/conda
CONDA_PREFIX=/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312
CONDA_PYTHON_EXE=/Users/ondrej/miniforge3/bin/python
CONDA_ROOT=/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312
CONDA_SHLVL=0
HOME=/Users/ondrej
INIT_CWD=/Users/ondrej/repos/conda-spawn
LANG=en_US.UTF-8
LOGNAME=ondrej
LaunchInstanceID=32E2787D-7A6E-407F-A89B-D9925AFA3564
PATH=/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/bin:/Users/ondrej/miniforge3/condabin:/Users/ondrej/.pixi/bin:/Users/ondrej/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/ondrej/.cargo/bin:/Users/ondrej/.cache/lm-studio/bin
PIXI_ENVIRONMENT_NAME=test-py312
PIXI_ENVIRONMENT_PLATFORMS=win-64,osx-arm64,osx-64,linux-64
PIXI_EXE=/Users/ondrej/.pixi/bin/pixi
PIXI_IN_SHELL=1
PIXI_PROJECT_MANIFEST=/Users/ondrej/repos/conda-spawn/pyproject.toml
PIXI_PROJECT_NAME=conda-spawn
PIXI_PROJECT_ROOT=/Users/ondrej/repos/conda-spawn
PIXI_PROJECT_VERSION=NO_VERSION_SPECIFIED
PIXI_PROMPT=(conda-spawn:test-py312)
PWD=/Users/ondrej/repos/conda-spawn
PYTEST_CURRENT_TEST=tests/test_shell.py::test_hooks_integration_posix (call)
SECURITYSESSIONID=186ac
SHELL=/bin/zsh
SHLVL=2
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.ahGPFv9VJs/Listeners
TERM=xterm-256color
TERM_PROGRAM=Apple_Terminal
TERM_PROGRAM_VERSION=455
TERM_SESSION_ID=EFF30468-FEAE-4F41-B83E-06B93969CE2C
TMPDIR=/var/folders/vg/lymvsp1153sgwwfdh3pm45hw0000gn/T/
USER=ondrej
XML_CATALOG_FILES=file:///Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/etc/xml/catalog file:///etc/xml/catalog
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
_=/usr/bin/env
_CE_CONDA=
_CE_M=
__CFBundleIdentifier=com.apple.Terminal
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
----------------------------- Captured stderr call -----------------------------
usage: __main__.py [-h] [-v] [--no-plugins] [-V] COMMAND ...
__main__.py: error: argument COMMAND: invalid choice: 'spawn' (choose from activate, clean, commands, compare, config, create, deactivate, env, export, info, init, install, list, notices, package, build, convert, debug, develop, doctor, index, inspect, metapackage, render, repoquery, skeleton, remove, uninstall, rename, run, search, update, upgrade)
_______________________ test_condabin_first_posix_shell ________________________
simple_env = PosixPath('/private/var/folders/vg/lymvsp1153sgwwfdh3pm45hw0000gn/T/pytest-of-ondrej/pytest-0/tmp_env-0')
conda_env = PosixPath('/private/var/folders/vg/lymvsp1153sgwwfdh3pm45hw0000gn/T/pytest-of-ondrej/pytest-0/tmp_env-1')
no_prompt = None
@pytest.mark.skipif(sys.platform == "win32", reason="Pty's only available on Unix")
def test_condabin_first_posix_shell(simple_env, conda_env, no_prompt):
shell = PosixShell(simple_env)
proc = shell.spawn_tty()
proc.sendline('echo "$PATH"')
proc.sendeof()
out = proc.read().decode()
print(out)
assert sys.prefix in out
assert str(simple_env) in out
assert out.index(sys.prefix) < out.index(str(simple_env))
shell = PosixShell(conda_env)
proc = shell.spawn_tty()
proc.sendline("which conda")
proc.sendeof()
print(out)
out = proc.read().decode()
> assert f"{sys.prefix}/condabin/conda" in out
E assert '/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/condabin/conda' in '\x1b[1m\x1b[7m%\x1b[27m\x1b[1m\x1b[0m \r \r\x1b]7;file://Ondrejs-MacBook-Pro.local/Users/ondrej/repos/conda-spawn\x07which conda\r\n^D\x08\x08\r\x1b[0m\x1b[27m\x1b[24m\x1b[J\x1b[34mrepos/conda-spawn\x1b[39m\x1b[32m(main)\x1b[39m$ \x1b[K\x1b[?2004hw\x08which conda\x1b[?2004l\r\r\nconda () {\r\n\t\\local cmd="${1-__missing__}"\r\n\tcase "$cmd" in\r\n\t\t(activate | deactivate) __conda_activate "$@" ;;\r\n\t\t(install | update | upgrade | remove | uninstall) __conda_exe "$@" || \\return\r\n\t\t\t__conda_activate reactivate ;;\r\n\t\t(*) __conda_exe "$@" ;;\r\n\tesac\r\n}\r\n\x1b[1m\x1b[7m%\x1b[27m\x1b[1m\x1b[0m \r \r\x1b]7;file://Ondrejs-MacBook-Pro.local/Users/ondrej/repos/conda-spawn\x07\r\x1b[0m\x1b[27m\x1b[24m\x1b[J\x1b[34mrepos/conda-spawn\x1b[39m\x1b[32m(main)\x1b[39m$ \x1b[K\x1b[?2004h\x1b[?2004l\r\r\n\r\nSaving session...\r\n...saving history...truncating history files...\r\n...completed.\r\n'
tests/test_shell.py:130: AssertionError
----------------------------- Captured stdout call -----------------------------
echo "$PATH"
repos/conda-spawn(main)$ echo "$PATH"
/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/condabin:/private/var/folders/vg/lymvsp1153sgwwfdh3pm45hw0000gn/T/pytest-of-ondrej/pytest-0/tmp_env-0/bin:/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/bin:/Users/ondrej/miniforge3/condabin:/Users/ondrej/.pixi/bin:/Users/ondrej/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/ondrej/.cargo/bin:/Users/ondrej/.cache/lm-studio/bin
repos/conda-spawn(main)$
Saving session...
...saving history...truncating history files...
...completed.
echo "$PATH"
repos/conda-spawn(main)$ echo "$PATH"
/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/condabin:/private/var/folders/vg/lymvsp1153sgwwfdh3pm45hw0000gn/T/pytest-of-ondrej/pytest-0/tmp_env-0/bin:/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/bin:/Users/ondrej/miniforge3/condabin:/Users/ondrej/.pixi/bin:/Users/ondrej/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/ondrej/.cargo/bin:/Users/ondrej/.cache/lm-studio/bin
repos/conda-spawn(main)$
Saving session...
...saving history...truncating history files...
...completed.
=============================== warnings summary ===============================
.pixi/envs/test-py312/lib/python3.12/site-packages/boltons/timeutils.py:426
/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/lib/python3.12/site-packages/boltons/timeutils.py:426: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
EPOCH_NAIVE = datetime.utcfromtimestamp(0)
tests/test_shell.py::test_posix_shell
tests/test_shell.py::test_condabin_first_posix_shell
/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/lib/python3.12/site-packages/conda_libmamba_solver/state.py:180: PendingDeprecationWarning: conda.core.index._supplement_index_with_system is pending deprecation and will be removed in 25.9. Use `conda.core.Index.reload` instead.
_supplement_index_with_system(virtual)
tests/test_shell.py::test_posix_shell
tests/test_shell.py::test_condabin_first_posix_shell
/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/lib/python3.12/site-packages/conda_libmamba_solver/solver.py:161: PendingDeprecationWarning: conda.common.io.Spinner is pending deprecation and will be removed in 25.9. Use `conda.reporters.get_spinner` instead.
with Spinner(
tests/test_shell.py::test_posix_shell
tests/test_shell.py::test_condabin_first_posix_shell
/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/lib/python3.12/site-packages/conda_libmamba_solver/solver.py:174: PendingDeprecationWarning: conda.common.io.Spinner is pending deprecation and will be removed in 25.9. Use `conda.reporters.get_spinner` instead.
with Spinner(
tests/test_shell.py::test_posix_shell
tests/test_shell.py::test_condabin_first_posix_shell
tests/test_shell.py::test_condabin_first_posix_shell
/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/lib/python3.12/pty.py:95: DeprecationWarning: This process (pid=48682) is multi-threaded, use of forkpty() may lead to deadlocks in the child.
pid, fd = os.forkpty()
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_cli.py::test_cli - assert not "usage: conda [-h] [-v] [--no-plugins] [-V] COMMAND ...\nconda: ...
FAILED tests/test_cli.py::test_nesting_disallowed - SystemExit: 2
FAILED tests/test_cli.py::test_nesting_replace - SystemExit: 2
FAILED tests/test_cli.py::test_nesting_stack - SystemExit: 2
FAILED tests/test_shell.py::test_hooks - SystemExit: 2
FAILED tests/test_shell.py::test_hooks_integration_posix - AssertionError: assert '/private/var/folders/vg/lymvsp1153sgwwfdh3pm45hw000...
FAILED tests/test_shell.py::test_condabin_first_posix_shell - assert '/Users/ondrej/repos/conda-spawn/.pixi/envs/test-py312/condabin/cond...
============= 7 failed, 1 passed, 6 skipped, 10 warnings in 15.64s =============Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels