spack.test.modules package

Submodules

spack.test.modules.common module

class spack.test.modules.common.MockDb(db_ids, spec_hash_to_db)[source]

Bases: object

db_for_spec_hash(spec_hash)[source]
class spack.test.modules.common.MockSpec(unique_id)[source]

Bases: object

dag_hash()[source]
spack.test.modules.common.mock_module_defaults(monkeypatch)[source]
spack.test.modules.common.mock_module_filename(monkeypatch, tmpdir)[source]
spack.test.modules.common.mock_package_perms(monkeypatch)[source]
spack.test.modules.common.test_get_module_upstream()[source]
spack.test.modules.common.test_load_installed_package_not_in_repo(install_mockery, mock_fetch, monkeypatch)[source]
spack.test.modules.common.test_modules_written_with_proper_permissions(mock_module_filename, mock_package_perms, mock_packages, config)[source]
spack.test.modules.common.test_update_dictionary_extending_list()[source]
spack.test.modules.common.test_upstream_module_index()[source]

spack.test.modules.conftest module

spack.test.modules.conftest.factory(request)[source]

Function that, given a spec string, returns an instance of the writer and the corresponding spec.

spack.test.modules.conftest.modulefile_content(request)[source]

Returns a function that generates the content of a module file as a list of lines.

spack.test.modules.conftest.update_template_dirs(config, monkeypatch)[source]

Mocks the template directories for tests

spack.test.modules.lmod module

class spack.test.modules.lmod.TestLmod[source]

Bases: object

pytestmark = [Mark(name='usefixtures', args=('config', 'mock_packages'), kwargs={})]
test_alter_environment(modulefile_content, module_configuration)[source]

Tests modifications to run-time environment.

test_autoload_all(modulefile_content, module_configuration)[source]

Tests the automatic loading of all dependencies.

test_autoload_direct(modulefile_content, module_configuration)[source]

Tests the automatic loading of direct dependencies.

test_blacklist(modulefile_content, module_configuration)[source]

Tests blacklisting the generation of selected modules.

test_config_backwards_compat(mutable_config)[source]
test_external_configure_args(factory)[source]
test_file_layout(compiler, provider, factory, module_configuration)[source]

Tests the layout of files in the hierarchy is the one expected.

test_guess_core_compilers(factory, module_configuration, monkeypatch)[source]

Check that we can guess core compilers.

test_modules_no_arch(factory, module_configuration)[source]
test_modules_relative_to_view(tmpdir, modulefile_content, module_configuration, install_mockery, mock_fetch)[source]
test_no_core_compilers(factory, module_configuration)[source]

Ensures that missing ‘core_compilers’ in the configuration file raises the right exception.

test_no_hash(factory, module_configuration)[source]

Makes sure that virtual providers (in the hierarchy) always include a hash. Make sure that the module file for the spec does not include a hash if hash_length is 0.

test_non_virtual_in_hierarchy(factory, module_configuration)[source]

Ensures that if a non-virtual is in hierarchy, an exception will be raised.

test_only_generic_microarchitectures_in_root(spec_str, factory, module_configuration)[source]
test_override_template_in_modules_yaml(modulefile_content, module_configuration)[source]

Tests overriding a template from modules.yaml

test_override_template_in_package(modulefile_content, module_configuration)[source]

Tests overriding a template from and attribute in the package.

test_prepend_path_separator(modulefile_content, module_configuration)[source]

Tests modifications to run-time environment.

test_projections_all(factory, module_configuration)[source]

Tests reading the correct naming scheme.

test_projections_specific(factory, module_configuration)[source]

Tests reading the correct naming scheme.

test_simple_case(modulefile_content, module_configuration)[source]

Tests the generation of a simple TCL module file.

spack.test.modules.lmod.compiler(request)[source]
spack.test.modules.lmod.provider(request)[source]
spack.test.modules.lmod.writer_cls

alias of spack.modules.lmod.LmodModulefileWriter

spack.test.modules.tcl module

class spack.test.modules.tcl.TestTcl[source]

Bases: object

pytestmark = [Mark(name='usefixtures', args=('config', 'mock_packages'), kwargs={})]
test_alter_environment(modulefile_content, module_configuration)[source]

Tests modifications to run-time environment.

test_autoload_all(modulefile_content, module_configuration)[source]

Tests the automatic loading of all dependencies.

test_autoload_direct(modulefile_content, module_configuration)[source]

Tests the automatic loading of direct dependencies.

test_autoload_with_constraints(modulefile_content, module_configuration, database)[source]

Tests the automatic loading of direct dependencies.

test_blacklist(modulefile_content, module_configuration)[source]

Tests blacklisting the generation of selected modules.

test_blacklist_implicits(modulefile_content, module_configuration, database)[source]
test_config_backwards_compat(mutable_config)[source]
test_conflicts(modulefile_content, module_configuration)[source]

Tests adding conflicts to the module.

test_extend_context(modulefile_content, module_configuration)[source]

Tests using a package defined context

test_invalid_naming_scheme(factory, module_configuration)[source]

Tests the evaluation of an invalid naming scheme.

test_invalid_token_in_env_name(factory, module_configuration)[source]

Tests setting environment variables with an invalid name.

test_module_index(module_configuration, factory, tmpdir_factory)[source]
test_modules_no_arch(factory, module_configuration)[source]
test_naming_scheme_compat(factory, module_configuration)[source]

Tests backwards compatibility for naming_scheme key

test_override_config(module_configuration, factory)[source]

Tests overriding some sections of the configuration file.

test_override_template_in_modules_yaml(modulefile_content, module_configuration)[source]

Tests overriding a template from modules.yaml

test_override_template_in_package(modulefile_content, module_configuration)[source]

Tests overriding a template from and attribute in the package.

test_prerequisites_all(modulefile_content, module_configuration)[source]

Tests asking all dependencies as prerequisites.

test_prerequisites_direct(modulefile_content, module_configuration)[source]

Tests asking direct dependencies as prerequisites.

test_projections_all(factory, module_configuration)[source]

Tests reading the correct naming scheme.

test_projections_specific(factory, module_configuration)[source]

Tests reading the correct naming scheme.

test_setup_environment(modulefile_content, module_configuration)[source]

Tests the internal set-up of run-time environment.

test_simple_case(modulefile_content, module_configuration)[source]

Tests the generation of a simple TCL module file.

test_suffixes(module_configuration, factory)[source]

Tests adding suffixes to module file name.

spack.test.modules.tcl.writer_cls

alias of spack.modules.tcl.TclModulefileWriter

Module contents