spack.test.cmd package

Submodules

spack.test.cmd.activate module

spack.test.cmd.activate.test_activate(mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.activate.test_deactivate(mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.activate.test_deactivate_all(mock_packages, mock_archive, mock_fetch, config, install_mockery)

spack.test.cmd.arch module

spack.test.cmd.arch.test_arch()

Sanity check spack arch to make sure it works.

spack.test.cmd.arch.test_arch_operating_system()

Sanity check spack arch --operating-system to make sure it works.

spack.test.cmd.arch.test_arch_platform()

Sanity check spack arch --platform to make sure it works.

spack.test.cmd.arch.test_arch_target()

Sanity check spack arch --target to make sure it works.

spack.test.cmd.arch.test_display_targets()

spack.test.cmd.blame module

spack.test.cmd.blame.test_blame_by_git(mock_packages, capfd)

Sanity check the blame command to make sure it works.

spack.test.cmd.blame.test_blame_by_modtime(mock_packages)

Sanity check the blame command to make sure it works.

spack.test.cmd.blame.test_blame_by_percent(mock_packages)

Sanity check the blame command to make sure it works.

spack.test.cmd.blame.test_blame_file(mock_packages)

Sanity check the blame command to make sure it works.

spack.test.cmd.build_env module

spack.test.cmd.build_env.test_dump(tmpdir)
spack.test.cmd.build_env.test_it_just_fails(pkg, error_cls)
spack.test.cmd.build_env.test_it_just_runs(pkg)
spack.test.cmd.build_env.test_pickle(tmpdir)

spack.test.cmd.buildcache module

spack.test.cmd.buildcache.mock_get_specs(database, monkeypatch)
spack.test.cmd.buildcache.mock_get_specs_multiarch(database, monkeypatch)
spack.test.cmd.buildcache.test_buildcache_create_fail_on_perm_denied(install_mockery, mock_fetch, monkeypatch, tmpdir)

Ensure that buildcache create fails on permission denied error.

spack.test.cmd.buildcache.test_buildcache_create_fails_on_noargs(tmpdir)

Ensure that buildcache create fails when given no args or environment.

spack.test.cmd.buildcache.test_buildcache_list_allarch(database, mock_get_specs_multiarch, capsys)
spack.test.cmd.buildcache.test_buildcache_list_duplicates(mock_get_specs, capsys)
spack.test.cmd.buildcache.test_buildcache_preview_just_runs(database)
spack.test.cmd.buildcache.test_update_key_index(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, mock_fetch, mock_stage, mock_gnupghome)

Test the update-index command with the –keys option

spack.test.cmd.buildcache.tests_buildcache_create(install_mockery, mock_fetch, monkeypatch, tmpdir)

“Ensure that buildcache create creates output files

spack.test.cmd.buildcache.tests_buildcache_create_env(install_mockery, mock_fetch, monkeypatch, tmpdir, mutable_mock_env_path)

“Ensure that buildcache create creates output files from env

spack.test.cmd.cd module

spack.test.cmd.cd.test_cd()

Sanity check the cd command to make sure it works.

spack.test.cmd.ci module

spack.test.cmd.ci.env_deactivate()
spack.test.cmd.ci.set_env_var(key, val)
spack.test.cmd.ci.test_ci_generate_bootstrap_artifacts_buildcache(tmpdir, mutable_mock_env_path, env_deactivate, install_mockery, mock_packages)

Test that we can bootstrap a compiler when artifacts buildcache is turned on

spack.test.cmd.ci.test_ci_generate_bootstrap_gcc(tmpdir, mutable_mock_env_path, env_deactivate, install_mockery, mock_packages)

Test that we can bootstrap a compiler and use it as the compiler for a spec in the environment

spack.test.cmd.ci.test_ci_generate_for_pr_pipeline(tmpdir, mutable_mock_env_path, env_deactivate, install_mockery, mock_packages)

Test that PR pipelines do not include a final stage job for rebuilding the mirror index, even if that job is specifically configured

spack.test.cmd.ci.test_ci_generate_override_runner_attrs(tmpdir, mutable_mock_env_path, env_deactivate, install_mockery, mock_packages, monkeypatch)

Test that we get the behavior we want with respect to the provision of runner attributes like tags, variables, and scripts, both when we inherit them from the top level, as well as when we override one or more at the runner level

spack.test.cmd.ci.test_ci_generate_pkg_with_deps(tmpdir, mutable_mock_env_path, env_deactivate, install_mockery, mock_packages)

Test pipeline generation for a package w/ dependencies

spack.test.cmd.ci.test_ci_generate_with_cdash_token(tmpdir, mutable_mock_env_path, env_deactivate, install_mockery, mock_packages)

Make sure we it doesn’t break if we configure cdash

spack.test.cmd.ci.test_ci_generate_with_custom_scripts(tmpdir, mutable_mock_env_path, env_deactivate, install_mockery, mock_packages, monkeypatch)

Test use of user-provided scripts

spack.test.cmd.ci.test_ci_generate_with_env(tmpdir, mutable_mock_env_path, env_deactivate, install_mockery, mock_packages)

Make sure we can get a .gitlab-ci.yml from an environment file which has the gitlab-ci, cdash, and mirrors sections.

spack.test.cmd.ci.test_ci_generate_with_env_missing_section(tmpdir, mutable_mock_env_path, env_deactivate, install_mockery, mock_packages)

Make sure we get a reasonable message if we omit gitlab-ci section

spack.test.cmd.ci.test_ci_generate_with_external_pkg(tmpdir, mutable_mock_env_path, env_deactivate, install_mockery, mock_packages)

Make sure we do not generate jobs for external pkgs

spack.test.cmd.ci.test_ci_rebuild_basic(tmpdir, mutable_mock_env_path, env_deactivate, install_mockery, mock_packages, mock_gnupghome)
spack.test.cmd.ci.test_push_mirror_contents(tmpdir, mutable_mock_env_path, env_deactivate, install_mockery, mock_packages, mock_fetch, mock_stage, mock_gnupghome)
spack.test.cmd.ci.test_specs_staging(config)

Make sure we achieve the best possible staging for the following spec DAG:

  a
 /|
c b
  |        e d
    |          f g

In this case, we would expect ‘c’, ‘e’, ‘f’, and ‘g’ to be in the first stage, and then ‘d’, ‘b’, and ‘a’ to be put in the next three stages, respectively.

spack.test.cmd.clean module

spack.test.cmd.clean.mock_calls_for_clean(monkeypatch)
spack.test.cmd.clean.test_function_calls(command_line, counters)

spack.test.cmd.commands module

spack.test.cmd.commands.test_bash_completion()

Test the bash completion writer.

spack.test.cmd.commands.test_names()

Test default output of spack commands.

spack.test.cmd.commands.test_no_pipe_error()

Make sure we don’t see any pipe errors when piping output.

spack.test.cmd.commands.test_rst()

Do some simple sanity checks of the rst writer.

spack.test.cmd.commands.test_rst_update(tmpdir)
spack.test.cmd.commands.test_rst_with_header(tmpdir)
spack.test.cmd.commands.test_rst_with_input_files(tmpdir)
spack.test.cmd.commands.test_subcommands()

Test subcommand traversal.

spack.test.cmd.commands.test_update_completion_arg(tmpdir, monkeypatch)
spack.test.cmd.commands.test_update_with_header(tmpdir)
spack.test.cmd.commands.test_updated_completion_scripts(tmpdir)

Make sure our shell tab completion scripts remain up-to-date.

spack.test.cmd.compiler module

spack.test.cmd.compiler.clangdir(tmpdir)

Create a directory with some dummy compiler scripts in it.

Scripts are:
  • clang
  • clang++
  • gcc
  • g++
  • gfortran-8
spack.test.cmd.compiler.mock_compiler_dir(tmpdir, mock_compiler_version)

Return a directory containing a fake, but detectable compiler.

spack.test.cmd.compiler.mock_compiler_version()
spack.test.cmd.compiler.no_compilers_yaml(mutable_config)

Creates a temporary configuration without compilers.yaml

spack.test.cmd.compiler.test_compiler_add(mutable_config, mock_packages, mock_compiler_dir, mock_compiler_version)
spack.test.cmd.compiler.test_compiler_find_mixed_suffixes(no_compilers_yaml, working_env, clangdir)

Ensure that we’ll mix compilers with different suffixes when necessary.

spack.test.cmd.compiler.test_compiler_find_no_apple_gcc(no_compilers_yaml, working_env, tmpdir)
spack.test.cmd.compiler.test_compiler_find_path_order(no_compilers_yaml, working_env, clangdir)

Ensure that we find compilers that come first in the PATH first

spack.test.cmd.compiler.test_compiler_find_prefer_no_suffix(no_compilers_yaml, working_env, clangdir)

Ensure that we’ll pick ‘clang’ over ‘clang-gpu’ when there is a choice.

spack.test.cmd.compiler.test_compiler_find_without_paths(no_compilers_yaml, working_env, tmpdir)
spack.test.cmd.compiler.test_compiler_remove(mutable_config, mock_packages)

spack.test.cmd.config module

spack.test.cmd.config.check_config_updated(data)
spack.test.cmd.config.check_packages_updated(data)

Check that the data from the packages_yaml_v015 has been updated.

spack.test.cmd.config.config_yaml_v015(mutable_config)

Create a packages.yaml in the old format

spack.test.cmd.config.packages_yaml_v015(mutable_config)

Create a packages.yaml in the old format

spack.test.cmd.config.test_config_add(mutable_empty_config)
spack.test.cmd.config.test_config_add_from_file(mutable_empty_config, tmpdir)
spack.test.cmd.config.test_config_add_from_file_multiple(mutable_empty_config, tmpdir)
spack.test.cmd.config.test_config_add_invalid_fails(mutable_empty_config)
spack.test.cmd.config.test_config_add_invalid_file_fails(tmpdir)
spack.test.cmd.config.test_config_add_list(mutable_empty_config)
spack.test.cmd.config.test_config_add_ordered_dict(mutable_empty_config)
spack.test.cmd.config.test_config_add_override(mutable_empty_config)
spack.test.cmd.config.test_config_add_override_from_file(mutable_empty_config, tmpdir)
spack.test.cmd.config.test_config_add_override_leaf(mutable_empty_config)
spack.test.cmd.config.test_config_add_override_leaf_from_file(mutable_empty_config, tmpdir)
spack.test.cmd.config.test_config_add_to_env(mutable_empty_config, mutable_mock_env_path)
spack.test.cmd.config.test_config_add_to_env_preserve_comments(mutable_empty_config, mutable_mock_env_path, tmpdir)
spack.test.cmd.config.test_config_add_update_dict(mutable_empty_config)
spack.test.cmd.config.test_config_add_update_dict_from_file(mutable_empty_config, tmpdir)
spack.test.cmd.config.test_config_edit()

Ensure spack config edit edits the right paths.

spack.test.cmd.config.test_config_edit_edits_spack_yaml(mutable_mock_env_path)
spack.test.cmd.config.test_config_edit_fails_correctly_with_no_env(mutable_mock_env_path)
spack.test.cmd.config.test_config_get_fails_correctly_with_no_env(mutable_mock_env_path)
spack.test.cmd.config.test_config_get_gets_spack_yaml(mutable_mock_env_path)
spack.test.cmd.config.test_config_list()
spack.test.cmd.config.test_config_remove_alias_rm(mutable_empty_config)
spack.test.cmd.config.test_config_remove_dict(mutable_empty_config)
spack.test.cmd.config.test_config_remove_from_env(mutable_empty_config, mutable_mock_env_path)
spack.test.cmd.config.test_config_remove_value(mutable_empty_config)
spack.test.cmd.config.test_config_revert(packages_yaml_v015)
spack.test.cmd.config.test_config_revert_raise_if_cant_write(packages_yaml_v015, monkeypatch)
spack.test.cmd.config.test_config_update_can_handle_comments(mutable_config)
spack.test.cmd.config.test_config_update_config(config_yaml_v015)
spack.test.cmd.config.test_config_update_fail_on_permission_issue(packages_yaml_v015, monkeypatch)
spack.test.cmd.config.test_config_update_not_needed(mutable_config)
spack.test.cmd.config.test_config_update_packages(packages_yaml_v015)

Test Spack updating old packages.yaml format for externals to new format. Ensure that data is preserved and converted properly.

spack.test.cmd.config.test_config_update_works_for_empty_paths(mutable_config)
spack.test.cmd.config.test_get_config_scope(mock_low_high_config)
spack.test.cmd.config.test_get_config_scope_merged(mock_low_high_config)
spack.test.cmd.config.test_remove_from_list(mutable_empty_config)
spack.test.cmd.config.test_remove_list(mutable_empty_config)
spack.test.cmd.config.test_updating_config_implicitly_raises(packages_yaml_v015)
spack.test.cmd.config.test_updating_multiple_scopes_at_once(packages_yaml_v015)

spack.test.cmd.create module

spack.test.cmd.create.parser()

Returns the parser for the module

spack.test.cmd.create.test_build_system_guesser_no_stage(parser)

Test build system guesser when stage not provided.

spack.test.cmd.create.test_build_system_guesser_octave(parser)

Test build system guesser for the special case, where the same base URL identifies the build system rather than guessing the build system from files contained in the archive.

spack.test.cmd.create.test_create_template(parser, mock_test_repo, args, name, expected)

Test template creation.

spack.test.cmd.create.test_create_template_bad_name(parser, mock_test_repo, name, expected, capsys)

Test template creation with bad name options.

spack.test.cmd.create.test_get_name_error(parser, monkeypatch, capsys)

Test get_name UndetectableNameError exception path.

spack.test.cmd.create.test_get_name_urls(parser, url, expected)

Test get_name with different URLs.

spack.test.cmd.debug module

spack.test.cmd.debug.test_create_db_tarball(tmpdir, database)
spack.test.cmd.debug.test_report()

spack.test.cmd.dependencies module

spack.test.cmd.dependencies.test_direct_dependencies(mock_packages)
spack.test.cmd.dependencies.test_direct_installed_dependencies(mock_packages, database)
spack.test.cmd.dependencies.test_transitive_dependencies(mock_packages)
spack.test.cmd.dependencies.test_transitive_dependencies_with_deptypes(mock_packages)
spack.test.cmd.dependencies.test_transitive_installed_dependencies(mock_packages, database)

spack.test.cmd.dependents module

spack.test.cmd.dependents.test_immediate_dependents(mock_packages)
spack.test.cmd.dependents.test_immediate_installed_dependents(mock_packages, database)
spack.test.cmd.dependents.test_transitive_dependents(mock_packages)
spack.test.cmd.dependents.test_transitive_installed_dependents(mock_packages, database)

spack.test.cmd.deprecate module

spack.test.cmd.deprecate.test_concretize_deprecated(mock_packages, mock_archive, mock_fetch, install_mockery)

Tests that the concretizer throws an error if we concretize to a deprecated spec

spack.test.cmd.deprecate.test_deprecate(mock_packages, mock_archive, mock_fetch, install_mockery)
spack.test.cmd.deprecate.test_deprecate_already_deprecated(mock_packages, mock_archive, mock_fetch, install_mockery)

Tests that we can re-deprecate a spec to change its deprecator.

spack.test.cmd.deprecate.test_deprecate_deprecator(mock_packages, mock_archive, mock_fetch, install_mockery)

Tests that when a deprecator spec is deprecated, its deprecatee specs are updated to point to the new deprecator.

spack.test.cmd.deprecate.test_deprecate_deps(mock_packages, mock_archive, mock_fetch, install_mockery)

Test that the deprecate command deprecates all dependencies properly.

spack.test.cmd.deprecate.test_deprecate_fails_active_extensions(mock_packages, mock_archive, mock_fetch, install_mockery)

Tests that active extensions and their extendees cannot be deprecated.

spack.test.cmd.deprecate.test_deprecate_fails_no_such_package(mock_packages, mock_archive, mock_fetch, install_mockery)

Tests that deprecating a spec that is not installed fails.

Tests that deprecating without the -i option in favor of a spec that is not installed fails.

spack.test.cmd.deprecate.test_deprecate_install(mock_packages, mock_archive, mock_fetch, install_mockery)

Tests that the `-i option allows us to deprecate in favor of a spec that is not yet installed.

spack.test.cmd.deprecate.test_uninstall_deprecated(mock_packages, mock_archive, mock_fetch, install_mockery)

Tests that we can still uninstall deprecated packages.

spack.test.cmd.dev_build module

spack.test.cmd.dev_build.test_dev_build_basics(tmpdir, mock_packages, install_mockery)
spack.test.cmd.dev_build.test_dev_build_before(tmpdir, mock_packages, install_mockery)
spack.test.cmd.dev_build.test_dev_build_before_until(tmpdir, mock_packages, install_mockery)
spack.test.cmd.dev_build.test_dev_build_drop_in(tmpdir, mock_packages, monkeypatch, install_mockery)
spack.test.cmd.dev_build.test_dev_build_env(tmpdir, mock_packages, install_mockery, mutable_mock_env_path)

Test Spack does dev builds for packages in develop section of env.

spack.test.cmd.dev_build.test_dev_build_env_dependency(tmpdir, mock_packages, install_mockery, mock_fetch, mutable_mock_env_path)

Test non-root specs in an environment are properly marked for dev builds.

spack.test.cmd.dev_build.test_dev_build_env_version_mismatch(tmpdir, mock_packages, install_mockery, mutable_mock_env_path)

Test Spack constraints concretization by develop specs.

spack.test.cmd.dev_build.test_dev_build_fails_already_installed(tmpdir, mock_packages, install_mockery)
spack.test.cmd.dev_build.test_dev_build_fails_multiple_specs(mock_packages)
spack.test.cmd.dev_build.test_dev_build_fails_no_spec()
spack.test.cmd.dev_build.test_dev_build_fails_no_version(mock_packages)
spack.test.cmd.dev_build.test_dev_build_fails_nonexistent_package_name(mock_packages)
spack.test.cmd.dev_build.test_dev_build_multiple(tmpdir, mock_packages, install_mockery, mutable_mock_env_path, mock_fetch)

Test spack install with multiple developer builds

spack.test.cmd.dev_build.test_dev_build_rebuild_on_source_changes(test_spec, tmpdir, mock_packages, install_mockery, mutable_mock_env_path, mock_fetch)

Test dev builds rebuild on changes to source code.

test_spec = dev-build-test-install tests rebuild for changes to package test_spec = dependent-of-dev-build tests rebuild for changes to dep

spack.test.cmd.dev_build.test_dev_build_until(tmpdir, mock_packages, install_mockery)
spack.test.cmd.dev_build.test_dev_build_until_last_phase(tmpdir, mock_packages, install_mockery)

spack.test.cmd.develop module

class spack.test.cmd.develop.TestDevelop

Bases: object

check_develop(env, spec, path=None)
pytestmark = [Mark(name='usefixtures', args=('mutable_mock_env_path', 'mock_packages', 'mock_fetch'), kwargs={})]
test_develop()
test_develop_no_args()
test_develop_no_clone(tmpdir)
test_develop_no_path_no_clone()
test_develop_twice()
test_develop_update_path(tmpdir)
test_develop_update_spec()

spack.test.cmd.env module

spack.test.cmd.env.check_mpileaks_and_deps_in_view(viewdir)

Check that the expected install directories exist.

spack.test.cmd.env.check_viewdir_removal(viewdir)

Check that the uninstall/removal worked.

spack.test.cmd.env.create_v1_lockfile_dict(roots, all_specs)
spack.test.cmd.env.env_deactivate()
spack.test.cmd.env.packages_yaml_v015(tmpdir)

Return the path to an existing manifest in the v0.15.x format and the path to a non yet existing backup file.

spack.test.cmd.env.test_add()
spack.test.cmd.env.test_bad_env_yaml_format(tmpdir)
spack.test.cmd.env.test_can_update_attributes_with_override(tmpdir)
spack.test.cmd.env.test_cant_install_single_spec_when_concretizing_together()
spack.test.cmd.env.test_concretize()
spack.test.cmd.env.test_concretize_user_specs_together()
spack.test.cmd.env.test_double_update(packages_yaml_v015)
spack.test.cmd.env.test_duplicate_packages_raise_when_concretizing_together()
spack.test.cmd.env.test_env_activate_broken_view(mutable_mock_env_path, mock_archive, mock_fetch, mock_packages, install_mockery)
spack.test.cmd.env.test_env_activate_csh_prints_shell_output(tmpdir, mock_stage, mock_fetch, install_mockery, env_deactivate)

Check the shell commands output by spack env activate --csh.

spack.test.cmd.env.test_env_activate_default_view_root_unconditional(env_deactivate, mutable_mock_env_path)

Check that the root of the default view in the environment is added to the shell unconditionally.

spack.test.cmd.env.test_env_activate_sh_prints_shell_output(tmpdir, mock_stage, mock_fetch, install_mockery, env_deactivate)

Check the shell commands output by spack env activate --sh.

This is a cursory check; share/spack/qa/setup-env-test.sh checks for correctness.

spack.test.cmd.env.test_env_activate_view_fails(tmpdir, mock_stage, mock_fetch, install_mockery, env_deactivate)

Sanity check on env activate to make sure it requires shell support

spack.test.cmd.env.test_env_add_nonexistant_fails()
spack.test.cmd.env.test_env_add_virtual()
spack.test.cmd.env.test_env_blocks_uninstall(mock_stage, mock_fetch, install_mockery)
spack.test.cmd.env.test_env_commands_die_with_no_env_arg()
spack.test.cmd.env.test_env_config_precedence()
spack.test.cmd.env.test_env_config_view_default(tmpdir, mock_stage, mock_fetch, install_mockery)
spack.test.cmd.env.test_env_install_all(install_mockery, mock_fetch)
spack.test.cmd.env.test_env_install_same_spec_twice(install_mockery, mock_fetch, capfd)
spack.test.cmd.env.test_env_install_single_spec(install_mockery, mock_fetch)
spack.test.cmd.env.test_env_list(mutable_mock_env_path)
spack.test.cmd.env.test_env_loads(install_mockery, mock_fetch)
spack.test.cmd.env.test_env_modifications_error_on_activate(install_mockery, mock_fetch, monkeypatch, capfd)
spack.test.cmd.env.test_env_remove(capfd)
spack.test.cmd.env.test_env_repo()
spack.test.cmd.env.test_env_status_broken_view(mutable_mock_env_path, mock_archive, mock_fetch, mock_packages, install_mockery)
spack.test.cmd.env.test_env_updates_view_add_concretize(tmpdir, mock_stage, mock_fetch, install_mockery)
spack.test.cmd.env.test_env_updates_view_force_remove(tmpdir, mock_stage, mock_fetch, install_mockery)
spack.test.cmd.env.test_env_updates_view_install(tmpdir, mock_stage, mock_fetch, install_mockery)
spack.test.cmd.env.test_env_updates_view_install_package(tmpdir, mock_stage, mock_fetch, install_mockery)
spack.test.cmd.env.test_env_updates_view_remove_concretize(tmpdir, mock_stage, mock_fetch, install_mockery)
spack.test.cmd.env.test_env_updates_view_uninstall(tmpdir, mock_stage, mock_fetch, install_mockery)
spack.test.cmd.env.test_env_updates_view_uninstall_referenced_elsewhere(tmpdir, mock_stage, mock_fetch, install_mockery)
spack.test.cmd.env.test_env_view_external_prefix(tmpdir_factory, mutable_database, mock_packages)
spack.test.cmd.env.test_env_view_fails(tmpdir, mock_packages, mock_stage, mock_fetch, install_mockery)
spack.test.cmd.env.test_env_with_config()
spack.test.cmd.env.test_env_with_include_config_files_same_basename()
spack.test.cmd.env.test_env_with_included_config_file()
spack.test.cmd.env.test_env_with_included_config_scope()
spack.test.cmd.env.test_env_with_included_config_var_path()
spack.test.cmd.env.test_env_without_view_install(tmpdir, mock_stage, mock_fetch, install_mockery)
spack.test.cmd.env.test_env_write_only_non_default()
spack.test.cmd.env.test_environment_status(capsys, tmpdir)
spack.test.cmd.env.test_included_config_precedence()
spack.test.cmd.env.test_indirect_build_dep()

Simple case of X->Y->Z where Y is a build/link dep and Z is a build-only dep. Make sure this concrete DAG is preserved when writing the environment out and reading it back.

spack.test.cmd.env.test_init_from_lockfile(tmpdir)

Test that an environment can be instantiated from a lockfile.

spack.test.cmd.env.test_init_from_yaml(tmpdir)

Test that an environment can be instantiated from a lockfile.

spack.test.cmd.env.test_init_with_file_and_remove(tmpdir)

Ensure a user can remove from any position in the spack.yaml file.

spack.test.cmd.env.test_lockfile_not_deleted_on_write_error(tmpdir, monkeypatch)
spack.test.cmd.env.test_newline_in_commented_sequence_is_not_an_issue(tmpdir)
spack.test.cmd.env.test_old_format_cant_be_updated_implicitly(packages_yaml_v015)
spack.test.cmd.env.test_read_old_lock_and_write_new(tmpdir)
spack.test.cmd.env.test_read_old_lock_creates_backup(tmpdir)

When reading a version-1 lockfile, make sure that a backup of that file is created.

spack.test.cmd.env.test_remove_after_concretize()
spack.test.cmd.env.test_remove_command()
spack.test.cmd.env.test_roots_display_with_variants()
spack.test.cmd.env.test_stack_combinatorial_view(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery)
spack.test.cmd.env.test_stack_concretize_extraneous_deps(tmpdir, config, mock_packages)
spack.test.cmd.env.test_stack_concretize_extraneous_variants(tmpdir, config, mock_packages)
spack.test.cmd.env.test_stack_concretize_extraneous_variants_with_dash(tmpdir, config, mock_packages)
spack.test.cmd.env.test_stack_definition_complex_conditional(tmpdir)
spack.test.cmd.env.test_stack_definition_conditional_add_write(tmpdir)
spack.test.cmd.env.test_stack_definition_conditional_false(tmpdir)
spack.test.cmd.env.test_stack_definition_conditional_invalid_variable(tmpdir)
spack.test.cmd.env.test_stack_definition_conditional_true(tmpdir)
spack.test.cmd.env.test_stack_definition_conditional_with_satisfaction(tmpdir)
spack.test.cmd.env.test_stack_definition_conditional_with_variable(tmpdir)
spack.test.cmd.env.test_stack_definition_extension(tmpdir)
spack.test.cmd.env.test_stack_view_activate_from_default(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery, env_deactivate)
spack.test.cmd.env.test_stack_view_exclude(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery)
spack.test.cmd.env.test_stack_view_multiple_views(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery, env_deactivate)
spack.test.cmd.env.test_stack_view_no_activate_without_default(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery, env_deactivate)
spack.test.cmd.env.test_stack_view_select(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery)
spack.test.cmd.env.test_stack_view_select_and_exclude(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery)
spack.test.cmd.env.test_stack_yaml_add_to_list(tmpdir)
spack.test.cmd.env.test_stack_yaml_definitions(tmpdir)
spack.test.cmd.env.test_stack_yaml_definitions_as_constraints(tmpdir)
spack.test.cmd.env.test_stack_yaml_definitions_as_constraints_on_matrix(tmpdir)
spack.test.cmd.env.test_stack_yaml_definitions_write_reference(tmpdir)
spack.test.cmd.env.test_stack_yaml_force_remove_from_matrix(tmpdir)
spack.test.cmd.env.test_stack_yaml_remove_from_list(tmpdir)
spack.test.cmd.env.test_stack_yaml_remove_from_list_force(tmpdir)
spack.test.cmd.env.test_stack_yaml_remove_from_matrix_no_effect(tmpdir)
spack.test.cmd.env.test_stage(mock_stage, mock_fetch, install_mockery)
spack.test.cmd.env.test_store_different_build_deps()

Ensure that an environment can store two instances of a build-only dependency:

      x       y
     /| (l)   | (b)
(b) | y       z2
     \| (b)
      z1
spack.test.cmd.env.test_to_lockfile_dict()
spack.test.cmd.env.test_uninstall_removes_from_env(mock_stage, mock_fetch, install_mockery)
spack.test.cmd.env.test_update_and_revert(packages_yaml_v015)
spack.test.cmd.env.test_update_anonymous_env(packages_yaml_v015)
spack.test.cmd.env.test_user_removed_spec()

Ensure a user can remove from any position in the spack.yaml file.

spack.test.cmd.env.test_with_config_bad_include(env_deactivate, capfd)

spack.test.cmd.extensions module

spack.test.cmd.extensions.python_database(mock_packages, mutable_database)
spack.test.cmd.extensions.test_extensions(mock_packages, python_database, capsys)
spack.test.cmd.extensions.test_extensions_no_arguments(mock_packages)
spack.test.cmd.extensions.test_extensions_raises_if_multiple_specs(mock_packages)
spack.test.cmd.extensions.test_extensions_raises_if_not_extendable(mock_packages)

spack.test.cmd.external module

spack.test.cmd.external.test_find_external_cmd(mutable_config, working_env, mock_executable)

Test invoking ‘spack external find’ with additional package arguments, which restricts the set of packages that Spack looks for.

spack.test.cmd.external.test_find_external_cmd_full_repo(mutable_config, working_env, mock_executable, mutable_mock_repo)

Test invoking ‘spack external find’ with no additional arguments, which iterates through each package in the repository.

spack.test.cmd.external.test_find_external_cmd_not_buildable(mutable_config, working_env, mock_executable)

When the user invokes ‘spack external find –not-buildable’, the config for any package where Spack finds an external version should be marked as not buildable.

spack.test.cmd.external.test_find_external_merge(mutable_config, mutable_mock_repo)

Check that ‘spack find external’ doesn’t overwrite an existing spec entry in packages.yaml.

spack.test.cmd.external.test_find_external_single_package(mock_executable)
spack.test.cmd.external.test_find_external_two_instances_same_package(mock_executable)
spack.test.cmd.external.test_find_external_update_config(mutable_config)
spack.test.cmd.external.test_get_executables(working_env, mock_executable)
spack.test.cmd.external.test_list_detectable_packages(mutable_config, mutable_mock_repo)
spack.test.cmd.external.test_new_entries_are_reported_correctly(mock_executable, mutable_config, monkeypatch)
spack.test.cmd.external.test_overriding_prefix(mock_executable, mutable_config, monkeypatch)
spack.test.cmd.external.test_packages_yaml_format(mock_executable, mutable_config, monkeypatch)

spack.test.cmd.find module

spack.test.cmd.find.mock_display(monkeypatch, specs)

Monkeypatches the display function to return its first argument

spack.test.cmd.find.parser()

Returns the parser for the module command

spack.test.cmd.find.specs()
spack.test.cmd.find.test_display_json(database, capsys)
spack.test.cmd.find.test_display_json_deps(database, capsys)
spack.test.cmd.find.test_find_command_basic_usage(database)
spack.test.cmd.find.test_find_format(database, config)
spack.test.cmd.find.test_find_format_deps(database, config)
spack.test.cmd.find.test_find_format_deps_paths(database, config)
spack.test.cmd.find.test_find_json(database)
spack.test.cmd.find.test_find_json_deps(database)
spack.test.cmd.find.test_find_loaded(database, working_env)
spack.test.cmd.find.test_find_no_sections(database, config)
spack.test.cmd.find.test_find_not_found(database, config, capsys)
spack.test.cmd.find.test_find_prefix_in_env(mutable_mock_env_path, install_mockery, mock_fetch, mock_packages, mock_archive, config)

Test find formats requiring concrete specs work in environments.

spack.test.cmd.find.test_find_show_compiler(database, config)
spack.test.cmd.find.test_find_very_long(database, config)
spack.test.cmd.find.test_namespaces_shown_correctly(database)
spack.test.cmd.find.test_query_arguments()
spack.test.cmd.find.test_tag1(parser, specs)
spack.test.cmd.find.test_tag2(parser, specs)
spack.test.cmd.find.test_tag2_tag3(parser, specs)

spack.test.cmd.flake8 module

spack.test.cmd.flake8.flake8_package()

Flake8 only checks files that have been modified. This fixture makes a small change to the flake8 mock package, yields the filename, then undoes the change on cleanup.

spack.test.cmd.flake8.parser()

Returns the parser for the flake8 command

spack.test.cmd.flake8.test_changed_files(parser, flake8_package)
spack.test.cmd.flake8.test_flake8(parser, flake8_package)

spack.test.cmd.gc module

spack.test.cmd.gc.test_gc_with_environment(config, mutable_database, mutable_mock_env_path, capsys)
spack.test.cmd.gc.test_no_packages_to_remove(config, mutable_database, capsys)
spack.test.cmd.gc.test_packages_are_removed(config, mutable_database, capsys)

spack.test.cmd.gpg module

spack.test.cmd.gpg.gpg = <spack.main.SpackCommand object>

spack command used by tests below

spack.test.cmd.gpg.test_find_gpg(cmd_name, version, tmpdir, mock_gnupghome, monkeypatch)
spack.test.cmd.gpg.test_gpg(tmpdir, mock_gnupghome)
spack.test.cmd.gpg.test_no_gpg_in_path(tmpdir, mock_gnupghome, monkeypatch)

spack.test.cmd.graph module

spack.test.cmd.graph.test_graph_ascii()

Tests spack graph –ascii

spack.test.cmd.graph.test_graph_deptype()

Tests spack graph –deptype

spack.test.cmd.graph.test_graph_dot()

Tests spack graph –dot

spack.test.cmd.graph.test_graph_installed()

Tests spack graph –installed

spack.test.cmd.graph.test_graph_no_specs()

Tests spack graph with no arguments

spack.test.cmd.graph.test_graph_static()

Tests spack graph –static

spack.test.cmd.help module

spack.test.cmd.help.test_help()

Sanity check the help command to make sure it works.

spack.test.cmd.help.test_help_all()

Test the spack help –all flag

spack.test.cmd.help.test_help_spec()

Test the spack help –spec flag

spack.test.cmd.help.test_help_subcommand()

Test the spack help subcommand argument

spack.test.cmd.help.test_reuse_after_help()

Test spack help can be called twice with the same SpackCommand.

spack.test.cmd.info module

spack.test.cmd.info.info_lines()
spack.test.cmd.info.mock_print(monkeypatch, info_lines)
spack.test.cmd.info.parser()

Returns the parser for the module command

spack.test.cmd.info.test_info_fields(pkg_query, parser, info_lines)
spack.test.cmd.info.test_it_just_runs(pkg)

spack.test.cmd.init_py_functions module

spack.test.cmd.init_py_functions.test_require_cmd_name()

By convention, Spack command names should contain dashes rather than underscores—ensure that require_cmd_name() raises the appropriate exception if underscores are detected.

spack.test.cmd.init_py_functions.test_require_python_name()

Python module names should not contain dashes—ensure that require_python_name() raises the appropriate exception if one is detected.

spack.test.cmd.install module

spack.test.cmd.install.noop_install(monkeypatch)
spack.test.cmd.install.test_build_error_output(tmpdir, mock_fetch, install_mockery, capfd)
spack.test.cmd.install.test_build_warning_output(tmpdir, mock_fetch, install_mockery, capfd)
spack.test.cmd.install.test_cache_install_full_hash_match(install_mockery_mutable_config, mock_packages, mock_fetch, mock_archive, mutable_config, monkeypatch, tmpdir)

Make sure installing from cache respects full hash argument

spack.test.cmd.install.test_cache_only_fails(tmpdir, mock_fetch, install_mockery)
spack.test.cmd.install.test_cdash_auth_token(tmpdir, install_mockery, capfd)
spack.test.cmd.install.test_cdash_buildstamp_param(tmpdir, mock_fetch, install_mockery, capfd)
spack.test.cmd.install.test_cdash_install_from_spec_yaml(tmpdir, mock_fetch, install_mockery, capfd, mock_packages, mock_archive, config)
spack.test.cmd.install.test_cdash_report_concretization_error(tmpdir, mock_fetch, install_mockery, capfd, conflict_spec)
spack.test.cmd.install.test_cdash_upload_build_error(tmpdir, mock_fetch, install_mockery, capfd)
spack.test.cmd.install.test_cdash_upload_clean_build(tmpdir, mock_fetch, install_mockery, capfd)
spack.test.cmd.install.test_cdash_upload_extra_params(tmpdir, mock_fetch, install_mockery, capfd)
spack.test.cmd.install.test_compiler_bootstrap(install_mockery_mutable_config, mock_packages, mock_fetch, mock_archive, mutable_config, monkeypatch)
spack.test.cmd.install.test_compiler_bootstrap_already_installed(install_mockery_mutable_config, mock_packages, mock_fetch, mock_archive, mutable_config, monkeypatch)
spack.test.cmd.install.test_compiler_bootstrap_from_binary_mirror(install_mockery_mutable_config, mock_packages, mock_fetch, mock_archive, mutable_config, monkeypatch, tmpdir)

Make sure installing compiler from buildcache registers compiler

spack.test.cmd.install.test_extra_files_are_archived(mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.install.test_install_conflicts(conflict_spec)
spack.test.cmd.install.test_install_deps_then_package(tmpdir, mock_fetch, install_mockery)
spack.test.cmd.install.test_install_dirty_flag(arguments, expected)
spack.test.cmd.install.test_install_fails_no_args(tmpdir)
spack.test.cmd.install.test_install_fails_no_args_suggests_env_activation(tmpdir)
spack.test.cmd.install.test_install_from_file(spec, concretize, error_code, tmpdir)
spack.test.cmd.install.test_install_help_cdash(capsys)

Make sure spack install –help-cdash describes CDash arguments

spack.test.cmd.install.test_install_help_does_not_show_cdash_options(capsys)

Make sure spack install –help does not describe CDash arguments

spack.test.cmd.install.test_install_invalid_spec(invalid_spec)
spack.test.cmd.install.test_install_mix_cli_and_files(clispecs, filespecs, tmpdir)
spack.test.cmd.install.test_install_only_dependencies(tmpdir, mock_fetch, install_mockery)
spack.test.cmd.install.test_install_only_dependencies_in_env(tmpdir, mock_fetch, install_mockery, mutable_mock_env_path)
spack.test.cmd.install.test_install_only_dependencies_of_all_in_env(tmpdir, mock_fetch, install_mockery, mutable_mock_env_path)
spack.test.cmd.install.test_install_only_package(tmpdir, mock_fetch, install_mockery, capfd)
spack.test.cmd.install.test_install_output_on_build_error(mock_packages, mock_archive, mock_fetch, config, install_mockery, capfd)
spack.test.cmd.install.test_install_output_on_python_error(mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.install.test_install_overwrite(mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.install.test_install_overwrite_multiple(mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.install.test_install_overwrite_not_installed(mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.install.test_install_package_already_installed(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.install.test_install_package_and_dependency(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.install.test_install_runtests_all(monkeypatch, mock_packages, install_mockery)
spack.test.cmd.install.test_install_runtests_notests(monkeypatch, mock_packages, install_mockery)
spack.test.cmd.install.test_install_runtests_root(monkeypatch, mock_packages, install_mockery)
spack.test.cmd.install.test_install_with_source(mock_packages, mock_archive, mock_fetch, config, install_mockery)

Verify that source has been copied into place.

spack.test.cmd.install.test_junit_output_with_errors(exc_typename, msg, mock_packages, mock_archive, mock_fetch, install_mockery, config, tmpdir, monkeypatch)
spack.test.cmd.install.test_junit_output_with_failures(tmpdir, exc_typename, msg)
spack.test.cmd.install.test_package_output(tmpdir, capsys, install_mockery, mock_fetch)

Ensure output printed from pkgs is captured by output redirection.

spack.test.cmd.install.test_show_log_on_error(mock_packages, mock_archive, mock_fetch, config, install_mockery, capfd)

Make sure –show-log-on-error works.

spack.test.cmd.is_git_repo module

spack.test.cmd.is_git_repo.check_git_version()

Check if git version is new enough for worktree functionality. Return True if requirements are met.

The latest required functionality is worktree remove which was only added in 2.17.0.

Refer: https://github.com/git/git/commit/cc73385cf6c5c229458775bc92e7dbbe24d11611

spack.test.cmd.is_git_repo.git_tmp_worktree(tmpdir)

Create new worktree in a temporary folder and monkeypatch spack.paths.prefix to point to it.

spack.test.cmd.is_git_repo.test_is_git_repo_in_worktree(git_tmp_worktree)

Verify that spack.cmd.spack_is_git_repo() can identify a git repository in a worktree.

spack.test.cmd.is_git_repo.test_spack_is_git_repo_nongit(tmpdir, monkeypatch)

Verify that spack.cmd.spack_is_git_repo() correctly returns False if we are in a non-git directory.

spack.test.cmd.license module

spack.test.cmd.license.test_list_files()
spack.test.cmd.license.test_verify(tmpdir)

spack.test.cmd.list module

spack.test.cmd.list.test_list()
spack.test.cmd.list.test_list_filter()
spack.test.cmd.list.test_list_format_html()
spack.test.cmd.list.test_list_format_name_only()
spack.test.cmd.list.test_list_format_version_json()
spack.test.cmd.list.test_list_search_description()
spack.test.cmd.list.test_list_tags()
spack.test.cmd.list.test_list_update(tmpdir)

spack.test.cmd.load module

spack.test.cmd.load.test_load(install_mockery, mock_fetch, mock_archive, mock_packages)

Test that the commands generated by load add the specified prefix inspections. Also test that Spack records loaded specs by hash in the user environment.

CMAKE_PREFIX_PATH is the only prefix inspection guaranteed for fake packages, since it keys on the prefix instead of a subdir.

spack.test.cmd.load.test_load_fails_no_shell(install_mockery, mock_fetch, mock_archive, mock_packages)

Test that spack load prints an error message without a shell.

spack.test.cmd.load.test_load_first(install_mockery, mock_fetch, mock_archive, mock_packages)

Test with and without the –first option

spack.test.cmd.load.test_load_includes_run_env(install_mockery, mock_fetch, mock_archive, mock_packages)

Tests that environment changes from the package’s setup_run_environment method are added to the user environment in addition to the prefix inspections

spack.test.cmd.load.test_load_recursive(install_mockery, mock_fetch, mock_archive, mock_packages)

Test that the ‘-r’ option to the load command prepends dependency prefix inspections in post-order

spack.test.cmd.load.test_unload(install_mockery, mock_fetch, mock_archive, mock_packages, working_env)

Tests that any variables set in the user environment are undone by the unload command

spack.test.cmd.load.test_unload_fails_no_shell(install_mockery, mock_fetch, mock_archive, mock_packages, working_env)

Test that spack unload prints an error message without a shell.

spack.test.cmd.location module

spack.test.cmd.location.mock_spec()
spack.test.cmd.location.mock_test_env()
spack.test.cmd.location.test_location_build_dir(mock_spec)

Tests spack location –build-dir.

spack.test.cmd.location.test_location_build_dir_missing()

Tests spack location –build-dir with a missing build directory.

spack.test.cmd.location.test_location_cmd_error(options)

Ensure the proper error is raised with problematic location options.

spack.test.cmd.location.test_location_env(mock_test_env)

Tests spack location –env.

spack.test.cmd.location.test_location_env_missing()

Tests spack location –env.

spack.test.cmd.location.test_location_install_dir(mock_spec)

Tests spack location –install-dir.

spack.test.cmd.location.test_location_package_dir(mock_spec)

Tests spack location –package-dir.

spack.test.cmd.location.test_location_paths_options(option, expected)

Tests basic spack.paths location command options.

spack.test.cmd.location.test_location_spec_errors(specs, expected)

Tests spack location with bad spec options.

spack.test.cmd.location.test_location_stage_dir(mock_spec)

Tests spack location –stage-dir.

spack.test.cmd.location.test_location_stages(mock_spec)

Tests spack location –stages.

spack.test.cmd.maintainers module

spack.test.cmd.maintainers.split(output)

Split command line output into an array.

spack.test.cmd.maintainers.test_all(mock_packages, capfd)
spack.test.cmd.maintainers.test_all_by_user(mock_packages, capfd)
spack.test.cmd.maintainers.test_maintained(mock_packages)
spack.test.cmd.maintainers.test_maintainers_list_by_user(mock_packages, capfd)
spack.test.cmd.maintainers.test_maintainers_list_fails(mock_packages, capfd)
spack.test.cmd.maintainers.test_maintainers_list_packages(mock_packages, capfd)
spack.test.cmd.maintainers.test_mutex_args_fail(mock_packages)
spack.test.cmd.maintainers.test_no_args(mock_packages)
spack.test.cmd.maintainers.test_no_args_by_user(mock_packages)
spack.test.cmd.maintainers.test_unmaintained(mock_packages)

spack.test.cmd.mirror module

class spack.test.cmd.mirror.MockMirrorArgs(specs=None, all=False, file=None, versions_per_spec=None, dependencies=False, exclude_file=None, exclude_specs=None)

Bases: object

spack.test.cmd.mirror.source_for_pkg_with_hash(mock_packages, tmpdir)
spack.test.cmd.mirror.test_exclude_file(mock_packages, tmpdir)
spack.test.cmd.mirror.test_exclude_specs(mock_packages)
spack.test.cmd.mirror.test_mirror_crud(tmp_scope, capsys)
spack.test.cmd.mirror.test_mirror_from_env(tmpdir, mock_packages, mock_fetch, config, mutable_mock_env_path)
spack.test.cmd.mirror.test_mirror_name_collision(tmp_scope)
spack.test.cmd.mirror.test_mirror_nonexisting(tmp_scope)
spack.test.cmd.mirror.test_mirror_skip_unstable(tmpdir_factory, mock_packages, config, source_for_pkg_with_hash)
spack.test.cmd.mirror.test_regression_8083(tmpdir, capfd, mock_packages, mock_fetch, config)
spack.test.cmd.mirror.tmp_scope()

Creates a temporary configuration scope

spack.test.cmd.module module

spack.test.cmd.module.ensure_module_files_are_there(mock_repo_path, mock_store, mock_configuration)

Generate module files for module tests.

spack.test.cmd.module.failure_args(request)

A list of arguments that will cause a failure

spack.test.cmd.module.module_type(request)
spack.test.cmd.module.test_deprecated_command(database, deprecated_command)
spack.test.cmd.module.test_exit_with_failure(database, module_type, failure_args)
spack.test.cmd.module.test_find(database, cli_args, module_type)
spack.test.cmd.module.test_find_fails_on_multiple_matches()
spack.test.cmd.module.test_find_fails_on_non_existing_packages()
spack.test.cmd.module.test_find_recursive()
spack.test.cmd.module.test_find_recursive_blacklisted(database, module_configuration)
spack.test.cmd.module.test_loads_recursive_blacklisted(database, module_configuration)
spack.test.cmd.module.test_remove_and_add(database, module_type)

Tests adding and removing a tcl module file.

spack.test.cmd.module.test_setdefault_command(mutable_database, module_configuration)

spack.test.cmd.pkg module

spack.test.cmd.pkg.mock_pkg_git_repo(tmpdir_factory)

Copy the builtin.mock repo and make a mutable git repo inside it.

spack.test.cmd.pkg.mock_pkg_names()
spack.test.cmd.pkg.pkg_template = 'from spack import *\n\nclass {name}(Package):\n homepage = "http://www.example.com"\n url = "http://www.example.com/test-1.0.tar.gz"\n\n version(\'1.0\', \'0123456789abcdef0123456789abcdef\')\n\n def install(self, spec, prefix):\n pass\n'

new fake package template

spack.test.cmd.pkg.split(output)

Split command line output into an array.

spack.test.cmd.pkg.test_mock_packages_path(mock_packages)
spack.test.cmd.pkg.test_packages_path()
spack.test.cmd.pkg.test_pkg_add(mock_pkg_git_repo)
spack.test.cmd.pkg.test_pkg_added(mock_pkg_git_repo)
spack.test.cmd.pkg.test_pkg_changed(mock_pkg_git_repo)
spack.test.cmd.pkg.test_pkg_diff(mock_pkg_git_repo, mock_pkg_names)
spack.test.cmd.pkg.test_pkg_fails_when_not_git_repo(monkeypatch)
spack.test.cmd.pkg.test_pkg_list(mock_pkg_git_repo, mock_pkg_names)
spack.test.cmd.pkg.test_pkg_removed(mock_pkg_git_repo)

spack.test.cmd.print_shell_vars module

spack.test.cmd.print_shell_vars.test_print_shell_vars_csh(capsys)
spack.test.cmd.print_shell_vars.test_print_shell_vars_csh_modules(capsys)
spack.test.cmd.print_shell_vars.test_print_shell_vars_sh(capsys)
spack.test.cmd.print_shell_vars.test_print_shell_vars_sh_modules(capsys)

spack.test.cmd.providers module

spack.test.cmd.providers.test_it_just_fails(pkg, error_cls)
spack.test.cmd.providers.test_it_just_runs(pkg)
spack.test.cmd.providers.test_provider_lists(vpkg, provider_list)

spack.test.cmd.python module

spack.test.cmd.python.test_python()
spack.test.cmd.python.test_python_raises()
spack.test.cmd.python.test_python_version()
spack.test.cmd.python.test_python_with_module()

spack.test.cmd.reindex module

spack.test.cmd.reindex.test_reindex_basic(mock_packages, mock_archive, mock_fetch, install_mockery)
spack.test.cmd.reindex.test_reindex_db_deleted(mock_packages, mock_archive, mock_fetch, install_mockery)
spack.test.cmd.reindex.test_reindex_with_deprecated_packages(mock_packages, mock_archive, mock_fetch, install_mockery)

spack.test.cmd.repo module

spack.test.cmd.repo.test_create_add_list_remove(mutable_config, tmpdir)
spack.test.cmd.repo.test_help_option()

spack.test.cmd.resource module

spack.test.cmd.resource.mock_hashes = ['abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234', '1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd', 'b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c', 'c45c1564f70def3fc1a6e22139f62cb21cd190cc3a7dbe6f4120fa59ce33dcb8', '24eceabef5fe8f575ff4b438313dc3e7b30f6a2d1c78841fbbe3b9293a589277', '689b8f9b32cb1d2f9271d29ea3fca2e1de5df665e121fca14e1364b711450deb', 'ebe27f9930b99ebd8761ed2db3ea365142d0bafd78317efb4baadf62c7bf94d0', '208fcfb50e5a965d5757d151b675ca4af4ce2dfd56401721b6168fae60ab798f', 'bf07a7fbb825fc0aae7bf4a1177b2b31fcf8a3feeaf7092761e18c859ee52a9c', '7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730']

these are hashes used in mock packages

spack.test.cmd.resource.test_resource_list(mock_packages, capfd)
spack.test.cmd.resource.test_resource_list_only_hashes(mock_packages, capfd)
spack.test.cmd.resource.test_resource_show(mock_packages, capfd)

spack.test.cmd.spec module

spack.test.cmd.spec.test_spec()
spack.test.cmd.spec.test_spec_deptypes_edges()
spack.test.cmd.spec.test_spec_deptypes_nodes()
spack.test.cmd.spec.test_spec_json()
spack.test.cmd.spec.test_spec_returncode()
spack.test.cmd.spec.test_spec_yaml()

spack.test.cmd.test module

spack.test.cmd.test.test_list()
spack.test.cmd.test.test_list_long(capsys)
spack.test.cmd.test.test_list_long_with_pytest_arg(capsys)
spack.test.cmd.test.test_list_names()
spack.test.cmd.test.test_list_names_with_pytest_arg()
spack.test.cmd.test.test_list_with_keywords()
spack.test.cmd.test.test_list_with_pytest_arg()
spack.test.cmd.test.test_pytest_help()

spack.test.cmd.undevelop module

spack.test.cmd.undevelop.test_undevelop(tmpdir, mock_packages, mutable_mock_env_path)
spack.test.cmd.undevelop.test_undevelop_nonexistent(tmpdir, mock_packages, mutable_mock_env_path)

spack.test.cmd.uninstall module

class spack.test.cmd.uninstall.MockArgs(packages, all=False, force=False, dependents=False)

Bases: object

spack.test.cmd.uninstall.test_force_uninstall_and_reinstall_by_hash(mutable_database)

Test forced uninstall and reinstall of old specs.

spack.test.cmd.uninstall.test_force_uninstall_spec_with_ref_count_not_zero(constraint, expected_number_of_specs, mutable_database)
spack.test.cmd.uninstall.test_in_memory_consistency_when_uninstalling(mutable_database, monkeypatch)

Test that uninstalling doesn’t raise warnings

spack.test.cmd.uninstall.test_installed_dependents(mutable_database)

Test can’t uninstall when there are installed dependents.

spack.test.cmd.uninstall.test_multiple_matches(mutable_database)

Test unable to uninstall when multiple matches.

spack.test.cmd.uninstall.test_recursive_uninstall(mutable_database)

Test recursive uninstall.

spack.test.cmd.uninstall.test_uninstall_spec_with_multiple_roots(constraint, expected_number_of_specs, mutable_database)

spack.test.cmd.url module

class spack.test.cmd.url.MyPackage(name, versions)

Bases: object

spack.test.cmd.url.test_name_parsed_correctly()
spack.test.cmd.url.test_url_list()
spack.test.cmd.url.test_url_parse()
spack.test.cmd.url.test_url_stats(capfd)
spack.test.cmd.url.test_url_summary()

Test the URL summary command.

spack.test.cmd.url.test_url_with_no_version_fails()
spack.test.cmd.url.test_version_parsed_correctly()

spack.test.cmd.verify module

Tests for the spack verify command

spack.test.cmd.verify.test_single_file_verify_cmd(tmpdir)
spack.test.cmd.verify.test_single_spec_verify_cmd(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)

spack.test.cmd.versions module

spack.test.cmd.versions.test_no_unchecksummed_versions()

Test a package for which no unchecksummed versions are available.

spack.test.cmd.versions.test_no_versions()

Test a package for which no remote versions are available.

spack.test.cmd.versions.test_no_versions_no_url()

Test a package without versions or a url attribute.

spack.test.cmd.versions.test_remote_versions()

Test a package for which remote versions should be available.

spack.test.cmd.versions.test_safe_versions()

Only test the safe versions of a package.

spack.test.cmd.versions.test_versions_no_url()

Test a package with versions but without a url attribute.

spack.test.cmd.view module

spack.test.cmd.view.create_projection_file(tmpdir, projection)
spack.test.cmd.view.test_view_extendee_with_global_activations(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.view.test_view_extension(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.view.test_view_extension_conflict(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.view.test_view_extension_conflict_ignored(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.view.test_view_extension_global_activation(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.view.test_view_extension_projection(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.view.test_view_extension_remove(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.view.test_view_external(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.view.test_view_fails_with_missing_projections_file(tmpdir)
spack.test.cmd.view.test_view_multiple_projections(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.view.test_view_multiple_projections_all_first(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)
spack.test.cmd.view.test_view_projections(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery, cmd)

Module contents