spack.test.modules package

Submodules

spack.test.modules.common module

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

Bases: object

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

Bases: object

dag_hash()
spack.test.modules.common.mock_module_filename(monkeypatch, tmpdir)
spack.test.modules.common.mock_package_perms(monkeypatch)
spack.test.modules.common.test_get_module_upstream()
spack.test.modules.common.test_modules_written_with_proper_permissions(mock_module_filename, mock_package_perms, mock_packages, config)
spack.test.modules.common.test_update_dictionary_extending_list()
spack.test.modules.common.test_upstream_module_index()

spack.test.modules.conftest module

spack.test.modules.conftest.factory(request)

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

spack.test.modules.conftest.file_registry()

Fake filesystem for modulefiles test

spack.test.modules.conftest.filename_dict(file_registry, monkeypatch)

Returns a fake open that writes on a StringIO instance instead of disk.

spack.test.modules.conftest.modulefile_content(filename_dict, request)

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

spack.test.modules.conftest.patch_configuration(monkeypatch, request)

Reads a configuration file from the mock ones prepared for tests and monkeypatches the right classes to hook it in.

spack.test.modules.conftest.update_template_dirs(config, monkeypatch)

Mocks the template directories for tests

spack.test.modules.lmod module

class spack.test.modules.lmod.TestLmod

Bases: object

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

Tests modifications to run-time environment.

test_autoload_all(modulefile_content, module_configuration)

Tests the automatic loading of all dependencies.

test_autoload_direct(modulefile_content, module_configuration)

Tests the automatic loading of direct dependencies.

test_blacklist(modulefile_content, module_configuration)

Tests blacklisting the generation of selected modules.

test_external_configure_args(factory)
test_file_layout(compiler, provider, factory, module_configuration)

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

test_guess_core_compilers(factory, module_configuration, monkeypatch)

Check that we can guess core compilers.

test_no_core_compilers(factory, module_configuration)

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

test_no_hash(factory, module_configuration)

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)

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)
test_override_template_in_modules_yaml(modulefile_content, module_configuration)

Tests overriding a template from modules.yaml

test_override_template_in_package(modulefile_content, module_configuration)

Tests overriding a template from and attribute in the package.

test_prepend_path_separator(modulefile_content, module_configuration)

Tests modifications to run-time environment.

test_simple_case(modulefile_content, module_configuration)

Tests the generation of a simple TCL module file.

spack.test.modules.lmod.compiler(request)
spack.test.modules.lmod.provider(request)
spack.test.modules.lmod.writer_cls

alias of spack.modules.lmod.LmodModulefileWriter

spack.test.modules.tcl module

class spack.test.modules.tcl.TestTcl

Bases: object

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

Tests modifications to run-time environment.

test_autoload_all(modulefile_content, module_configuration)

Tests the automatic loading of all dependencies.

test_autoload_direct(modulefile_content, module_configuration)

Tests the automatic loading of direct dependencies.

test_autoload_with_constraints(modulefile_content, module_configuration, database)

Tests the automatic loading of direct dependencies.

test_blacklist(modulefile_content, module_configuration)

Tests blacklisting the generation of selected modules.

test_blacklist_implicits(modulefile_content, module_configuration, database)
test_conflicts(modulefile_content, module_configuration)

Tests adding conflicts to the module.

test_extend_context(modulefile_content, module_configuration)

Tests using a package defined context

test_invalid_naming_scheme(factory, module_configuration)

Tests the evaluation of an invalid naming scheme.

test_invalid_token_in_env_name(factory, module_configuration)

Tests setting environment variables with an invalid name.

test_module_index(module_configuration, factory, tmpdir_factory)
test_naming_scheme(factory, module_configuration)

Tests reading the correct naming scheme.

test_override_template_in_modules_yaml(modulefile_content, module_configuration)

Tests overriding a template from modules.yaml

test_override_template_in_package(modulefile_content, module_configuration)

Tests overriding a template from and attribute in the package.

test_prerequisites_all(modulefile_content, module_configuration)

Tests asking all dependencies as prerequisites.

test_prerequisites_direct(modulefile_content, module_configuration)

Tests asking direct dependencies as prerequisites.

test_setup_environment(modulefile_content, module_configuration)

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

test_simple_case(modulefile_content, module_configuration)

Tests the generation of a simple TCL module file.

test_suffixes(module_configuration, factory)

Tests adding suffixes to module file name.

spack.test.modules.tcl.writer_cls

alias of spack.modules.tcl.TclModulefileWriter

Module contents