modules: unit-tests without polluted user scope (#41041)
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							a6179f26b9
						
					
				
				
					commit
					8a8dcb9479
				
			@@ -62,7 +62,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#: config section for this file
 | 
					#: config section for this file
 | 
				
			||||||
def configuration(module_set_name):
 | 
					def configuration(module_set_name):
 | 
				
			||||||
    config_path = "modules:%s" % module_set_name
 | 
					    config_path = f"modules:{module_set_name}"
 | 
				
			||||||
    return spack.config.get(config_path, {})
 | 
					    return spack.config.get(config_path, {})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -96,10 +96,10 @@ def _check_tokens_are_valid(format_string, message):
 | 
				
			|||||||
    named_tokens = re.findall(r"{(\w*)}", format_string)
 | 
					    named_tokens = re.findall(r"{(\w*)}", format_string)
 | 
				
			||||||
    invalid_tokens = [x for x in named_tokens if x.lower() not in _valid_tokens]
 | 
					    invalid_tokens = [x for x in named_tokens if x.lower() not in _valid_tokens]
 | 
				
			||||||
    if invalid_tokens:
 | 
					    if invalid_tokens:
 | 
				
			||||||
        msg = message
 | 
					        raise RuntimeError(
 | 
				
			||||||
        msg += " [{0}]. ".format(", ".join(invalid_tokens))
 | 
					            f"{message} [{', '.join(invalid_tokens)}]. "
 | 
				
			||||||
        msg += 'Did you check your "modules.yaml" configuration?'
 | 
					            f"Did you check your 'modules.yaml' configuration?"
 | 
				
			||||||
        raise RuntimeError(msg)
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def update_dictionary_extending_lists(target, update):
 | 
					def update_dictionary_extending_lists(target, update):
 | 
				
			||||||
@@ -219,7 +219,7 @@ def root_path(name, module_set_name):
 | 
				
			|||||||
    """
 | 
					    """
 | 
				
			||||||
    defaults = {"lmod": "$spack/share/spack/lmod", "tcl": "$spack/share/spack/modules"}
 | 
					    defaults = {"lmod": "$spack/share/spack/lmod", "tcl": "$spack/share/spack/modules"}
 | 
				
			||||||
    # Root folders where the various module files should be written
 | 
					    # Root folders where the various module files should be written
 | 
				
			||||||
    roots = spack.config.get("modules:%s:roots" % module_set_name, {})
 | 
					    roots = spack.config.get(f"modules:{module_set_name}:roots", {})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Merge config values into the defaults so we prefer configured values
 | 
					    # Merge config values into the defaults so we prefer configured values
 | 
				
			||||||
    roots = spack.config.merge_yaml(defaults, roots)
 | 
					    roots = spack.config.merge_yaml(defaults, roots)
 | 
				
			||||||
@@ -262,7 +262,7 @@ def read_module_index(root):
 | 
				
			|||||||
    index_path = os.path.join(root, "module-index.yaml")
 | 
					    index_path = os.path.join(root, "module-index.yaml")
 | 
				
			||||||
    if not os.path.exists(index_path):
 | 
					    if not os.path.exists(index_path):
 | 
				
			||||||
        return {}
 | 
					        return {}
 | 
				
			||||||
    with open(index_path, "r") as index_file:
 | 
					    with open(index_path) as index_file:
 | 
				
			||||||
        return _read_module_index(index_file)
 | 
					        return _read_module_index(index_file)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -310,21 +310,21 @@ def upstream_module(self, spec, module_type):
 | 
				
			|||||||
        if db_for_spec in self.upstream_dbs:
 | 
					        if db_for_spec in self.upstream_dbs:
 | 
				
			||||||
            db_index = self.upstream_dbs.index(db_for_spec)
 | 
					            db_index = self.upstream_dbs.index(db_for_spec)
 | 
				
			||||||
        elif db_for_spec:
 | 
					        elif db_for_spec:
 | 
				
			||||||
            raise spack.error.SpackError("Unexpected: {0} is installed locally".format(spec))
 | 
					            raise spack.error.SpackError(f"Unexpected: {spec} is installed locally")
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            raise spack.error.SpackError("Unexpected: no install DB found for {0}".format(spec))
 | 
					            raise spack.error.SpackError(f"Unexpected: no install DB found for {spec}")
 | 
				
			||||||
        module_index = self.module_indices[db_index]
 | 
					        module_index = self.module_indices[db_index]
 | 
				
			||||||
        module_type_index = module_index.get(module_type, {})
 | 
					        module_type_index = module_index.get(module_type, {})
 | 
				
			||||||
        if not module_type_index:
 | 
					        if not module_type_index:
 | 
				
			||||||
            tty.debug(
 | 
					            tty.debug(
 | 
				
			||||||
                "No {0} modules associated with the Spack instance where"
 | 
					                f"No {module_type} modules associated with the Spack instance "
 | 
				
			||||||
                " {1} is installed".format(module_type, spec)
 | 
					                f"where {spec} is installed"
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            return None
 | 
					            return None
 | 
				
			||||||
        if spec.dag_hash() in module_type_index:
 | 
					        if spec.dag_hash() in module_type_index:
 | 
				
			||||||
            return module_type_index[spec.dag_hash()]
 | 
					            return module_type_index[spec.dag_hash()]
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            tty.debug("No module is available for upstream package {0}".format(spec))
 | 
					            tty.debug(f"No module is available for upstream package {spec}")
 | 
				
			||||||
            return None
 | 
					            return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -603,7 +603,7 @@ def filename(self):
 | 
				
			|||||||
        # Just the name of the file
 | 
					        # Just the name of the file
 | 
				
			||||||
        filename = self.use_name
 | 
					        filename = self.use_name
 | 
				
			||||||
        if self.extension:
 | 
					        if self.extension:
 | 
				
			||||||
            filename = "{0}.{1}".format(self.use_name, self.extension)
 | 
					            filename = f"{self.use_name}.{self.extension}"
 | 
				
			||||||
        # Architecture sub-folder
 | 
					        # Architecture sub-folder
 | 
				
			||||||
        arch_folder_conf = spack.config.get("modules:%s:arch_folder" % self.conf.name, True)
 | 
					        arch_folder_conf = spack.config.get("modules:%s:arch_folder" % self.conf.name, True)
 | 
				
			||||||
        if arch_folder_conf:
 | 
					        if arch_folder_conf:
 | 
				
			||||||
@@ -671,7 +671,7 @@ def configure_options(self):
 | 
				
			|||||||
            return msg
 | 
					            return msg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if os.path.exists(pkg.install_configure_args_path):
 | 
					        if os.path.exists(pkg.install_configure_args_path):
 | 
				
			||||||
            with open(pkg.install_configure_args_path, "r") as args_file:
 | 
					            with open(pkg.install_configure_args_path) as args_file:
 | 
				
			||||||
                return spack.util.path.padding_filter(args_file.read())
 | 
					                return spack.util.path.padding_filter(args_file.read())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Returning a false-like value makes the default templates skip
 | 
					        # Returning a false-like value makes the default templates skip
 | 
				
			||||||
@@ -886,7 +886,7 @@ def _get_template(self):
 | 
				
			|||||||
        # 2. template specified in a package directly
 | 
					        # 2. template specified in a package directly
 | 
				
			||||||
        # 3. default template (must be defined, check in __init__)
 | 
					        # 3. default template (must be defined, check in __init__)
 | 
				
			||||||
        module_system_name = str(self.module.__name__).split(".")[-1]
 | 
					        module_system_name = str(self.module.__name__).split(".")[-1]
 | 
				
			||||||
        package_attribute = "{0}_template".format(module_system_name)
 | 
					        package_attribute = f"{module_system_name}_template"
 | 
				
			||||||
        choices = [
 | 
					        choices = [
 | 
				
			||||||
            self.conf.template,
 | 
					            self.conf.template,
 | 
				
			||||||
            getattr(self.spec.package, package_attribute, None),
 | 
					            getattr(self.spec.package, package_attribute, None),
 | 
				
			||||||
@@ -952,7 +952,7 @@ def write(self, overwrite=False):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        # Attribute from package
 | 
					        # Attribute from package
 | 
				
			||||||
        module_name = str(self.module.__name__).split(".")[-1]
 | 
					        module_name = str(self.module.__name__).split(".")[-1]
 | 
				
			||||||
        attr_name = "{0}_context".format(module_name)
 | 
					        attr_name = f"{module_name}_context"
 | 
				
			||||||
        pkg_update = getattr(self.spec.package, attr_name, {})
 | 
					        pkg_update = getattr(self.spec.package, attr_name, {})
 | 
				
			||||||
        context.update(pkg_update)
 | 
					        context.update(pkg_update)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1002,7 +1002,7 @@ def update_module_hiddenness(self, remove=False):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if modulerc_exists:
 | 
					        if modulerc_exists:
 | 
				
			||||||
            # retrieve modulerc content
 | 
					            # retrieve modulerc content
 | 
				
			||||||
            with open(modulerc_path, "r") as f:
 | 
					            with open(modulerc_path) as f:
 | 
				
			||||||
                content = f.readlines()
 | 
					                content = f.readlines()
 | 
				
			||||||
                content = "".join(content).split("\n")
 | 
					                content = "".join(content).split("\n")
 | 
				
			||||||
                # remove last empty item if any
 | 
					                # remove last empty item if any
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -53,6 +53,7 @@
 | 
				
			|||||||
stage = SpackCommand("stage")
 | 
					stage = SpackCommand("stage")
 | 
				
			||||||
uninstall = SpackCommand("uninstall")
 | 
					uninstall = SpackCommand("uninstall")
 | 
				
			||||||
find = SpackCommand("find")
 | 
					find = SpackCommand("find")
 | 
				
			||||||
 | 
					module = SpackCommand("module")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sep = os.sep
 | 
					sep = os.sep
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1105,13 +1106,14 @@ def test_multi_env_remove(mutable_mock_env_path, monkeypatch, answer):
 | 
				
			|||||||
        assert all(e in env("list") for e in environments)
 | 
					        assert all(e in env("list") for e in environments)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_env_loads(install_mockery, mock_fetch):
 | 
					def test_env_loads(install_mockery, mock_fetch, mock_modules_root):
 | 
				
			||||||
    env("create", "test")
 | 
					    env("create", "test")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    with ev.read("test"):
 | 
					    with ev.read("test"):
 | 
				
			||||||
        add("mpileaks")
 | 
					        add("mpileaks")
 | 
				
			||||||
        concretize()
 | 
					        concretize()
 | 
				
			||||||
        install("--fake")
 | 
					        install("--fake")
 | 
				
			||||||
 | 
					        module("tcl", "refresh", "-y")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    with ev.read("test"):
 | 
					    with ev.read("test"):
 | 
				
			||||||
        env("loads")
 | 
					        env("loads")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,6 +6,7 @@
 | 
				
			|||||||
import collections
 | 
					import collections
 | 
				
			||||||
import datetime
 | 
					import datetime
 | 
				
			||||||
import errno
 | 
					import errno
 | 
				
			||||||
 | 
					import functools
 | 
				
			||||||
import inspect
 | 
					import inspect
 | 
				
			||||||
import itertools
 | 
					import itertools
 | 
				
			||||||
import json
 | 
					import json
 | 
				
			||||||
@@ -1967,3 +1968,14 @@ def __exit__(self, *args):
 | 
				
			|||||||
            pass
 | 
					            pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    monkeypatch.setattr(spack.cmd.buildcache, "_make_pool", MockPool)
 | 
					    monkeypatch.setattr(spack.cmd.buildcache, "_make_pool", MockPool)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def _root_path(x, y, *, path):
 | 
				
			||||||
 | 
					    return path
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@pytest.fixture
 | 
				
			||||||
 | 
					def mock_modules_root(tmp_path, monkeypatch):
 | 
				
			||||||
 | 
					    """Sets the modules root to a temporary directory, to avoid polluting configuration scopes."""
 | 
				
			||||||
 | 
					    fn = functools.partial(_root_path, path=str(tmp_path))
 | 
				
			||||||
 | 
					    monkeypatch.setattr(spack.modules.common, "root_path", fn)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,12 +14,7 @@
 | 
				
			|||||||
#   ~/.spack/modules.yaml
 | 
					#   ~/.spack/modules.yaml
 | 
				
			||||||
# -------------------------------------------------------------------------
 | 
					# -------------------------------------------------------------------------
 | 
				
			||||||
modules:
 | 
					modules:
 | 
				
			||||||
  default:
 | 
					  default: {}
 | 
				
			||||||
    enable:
 | 
					 | 
				
			||||||
      - tcl
 | 
					 | 
				
			||||||
    roots:
 | 
					 | 
				
			||||||
      tcl: $user_cache_path/tcl
 | 
					 | 
				
			||||||
      lmod: $user_cache_path/lmod
 | 
					 | 
				
			||||||
  prefix_inspections:
 | 
					  prefix_inspections:
 | 
				
			||||||
    bin:
 | 
					    bin:
 | 
				
			||||||
      - PATH
 | 
					      - PATH
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,7 +17,10 @@
 | 
				
			|||||||
from spack.modules.common import UpstreamModuleIndex
 | 
					from spack.modules.common import UpstreamModuleIndex
 | 
				
			||||||
from spack.spec import Spec
 | 
					from spack.spec import Spec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pytestmark = pytest.mark.not_on_windows("does not run on windows")
 | 
					pytestmark = [
 | 
				
			||||||
 | 
					    pytest.mark.not_on_windows("does not run on windows"),
 | 
				
			||||||
 | 
					    pytest.mark.usefixtures("mock_modules_root"),
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_update_dictionary_extending_list():
 | 
					def test_update_dictionary_extending_list():
 | 
				
			||||||
@@ -174,6 +177,7 @@ def test_load_installed_package_not_in_repo(install_mockery, mock_fetch, monkeyp
 | 
				
			|||||||
    """Test that installed packages that have been removed are still loadable"""
 | 
					    """Test that installed packages that have been removed are still loadable"""
 | 
				
			||||||
    spec = Spec("trivial-install-test-package").concretized()
 | 
					    spec = Spec("trivial-install-test-package").concretized()
 | 
				
			||||||
    spec.package.do_install()
 | 
					    spec.package.do_install()
 | 
				
			||||||
 | 
					    spack.modules.module_types["tcl"](spec, "default", True).write()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def find_nothing(*args):
 | 
					    def find_nothing(*args):
 | 
				
			||||||
        raise spack.repo.UnknownPackageError("Repo package access is disabled for test")
 | 
					        raise spack.repo.UnknownPackageError("Repo package access is disabled for test")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,8 @@
 | 
				
			|||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
 | 
					# Spack Project Developers. See the top-level COPYRIGHT file for details.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
 | 
					# SPDX-License-Identifier: (Apache-2.0 OR MIT)
 | 
				
			||||||
 | 
					import pathlib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import pytest
 | 
					import pytest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import spack.config
 | 
					import spack.config
 | 
				
			||||||
@@ -13,26 +15,15 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
@pytest.fixture()
 | 
					@pytest.fixture()
 | 
				
			||||||
def modulefile_content(request):
 | 
					def modulefile_content(request):
 | 
				
			||||||
    """Returns a function that generates the content of a module file
 | 
					    """Returns a function that generates the content of a module file as a list of lines."""
 | 
				
			||||||
    as a list of lines.
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    writer_cls = getattr(request.module, "writer_cls")
 | 
					    writer_cls = getattr(request.module, "writer_cls")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _impl(spec_str, module_set_name="default", explicit=True):
 | 
					    def _impl(spec_str, module_set_name="default", explicit=True):
 | 
				
			||||||
        # Write the module file
 | 
					        spec = spack.spec.Spec(spec_str).concretized()
 | 
				
			||||||
        spec = spack.spec.Spec(spec_str)
 | 
					 | 
				
			||||||
        spec.concretize()
 | 
					 | 
				
			||||||
        generator = writer_cls(spec, module_set_name, explicit)
 | 
					        generator = writer_cls(spec, module_set_name, explicit)
 | 
				
			||||||
        generator.write(overwrite=True)
 | 
					        generator.write(overwrite=True)
 | 
				
			||||||
 | 
					        written_module = pathlib.Path(generator.layout.filename)
 | 
				
			||||||
        # Get its filename
 | 
					        content = written_module.read_text().splitlines()
 | 
				
			||||||
        filename = generator.layout.filename
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        # Retrieve the content
 | 
					 | 
				
			||||||
        with open(filename) as f:
 | 
					 | 
				
			||||||
            content = f.readlines()
 | 
					 | 
				
			||||||
            content = "".join(content).split("\n")
 | 
					 | 
				
			||||||
        generator.remove()
 | 
					        generator.remove()
 | 
				
			||||||
        return content
 | 
					        return content
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -40,27 +31,21 @@ def _impl(spec_str, module_set_name="default", explicit=True):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.fixture()
 | 
					@pytest.fixture()
 | 
				
			||||||
def factory(request):
 | 
					def factory(request, mock_modules_root):
 | 
				
			||||||
    """Function that, given a spec string, returns an instance of the writer
 | 
					    """Given a spec string, returns an instance of the writer and the corresponding spec."""
 | 
				
			||||||
    and the corresponding spec.
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Class of the module file writer
 | 
					 | 
				
			||||||
    writer_cls = getattr(request.module, "writer_cls")
 | 
					    writer_cls = getattr(request.module, "writer_cls")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _mock(spec_string, module_set_name="default", explicit=True):
 | 
					    def _mock(spec_string, module_set_name="default", explicit=True):
 | 
				
			||||||
        spec = spack.spec.Spec(spec_string)
 | 
					        spec = spack.spec.Spec(spec_string).concretized()
 | 
				
			||||||
        spec.concretize()
 | 
					 | 
				
			||||||
        return writer_cls(spec, module_set_name, explicit), spec
 | 
					        return writer_cls(spec, module_set_name, explicit), spec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return _mock
 | 
					    return _mock
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.fixture()
 | 
					@pytest.fixture()
 | 
				
			||||||
def mock_module_filename(monkeypatch, tmpdir):
 | 
					def mock_module_filename(monkeypatch, tmp_path):
 | 
				
			||||||
    filename = str(tmpdir.join("module"))
 | 
					    filename = tmp_path / "module"
 | 
				
			||||||
    # Set for both module types so we can test both
 | 
					    # Set for both module types so we can test both
 | 
				
			||||||
    monkeypatch.setattr(spack.modules.lmod.LmodFileLayout, "filename", filename)
 | 
					    monkeypatch.setattr(spack.modules.lmod.LmodFileLayout, "filename", str(filename))
 | 
				
			||||||
    monkeypatch.setattr(spack.modules.tcl.TclFileLayout, "filename", filename)
 | 
					    monkeypatch.setattr(spack.modules.tcl.TclFileLayout, "filename", str(filename))
 | 
				
			||||||
 | 
					    yield str(filename)
 | 
				
			||||||
    yield filename
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,7 +21,10 @@
 | 
				
			|||||||
#: Class of the writer tested in this module
 | 
					#: Class of the writer tested in this module
 | 
				
			||||||
writer_cls = spack.modules.lmod.LmodModulefileWriter
 | 
					writer_cls = spack.modules.lmod.LmodModulefileWriter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pytestmark = pytest.mark.not_on_windows("does not run on windows")
 | 
					pytestmark = [
 | 
				
			||||||
 | 
					    pytest.mark.not_on_windows("does not run on windows"),
 | 
				
			||||||
 | 
					    pytest.mark.usefixtures("mock_modules_root"),
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.fixture(params=["clang@=12.0.0", "gcc@=10.2.1"])
 | 
					@pytest.fixture(params=["clang@=12.0.0", "gcc@=10.2.1"])
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,7 +18,10 @@
 | 
				
			|||||||
#: Class of the writer tested in this module
 | 
					#: Class of the writer tested in this module
 | 
				
			||||||
writer_cls = spack.modules.tcl.TclModulefileWriter
 | 
					writer_cls = spack.modules.tcl.TclModulefileWriter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pytestmark = pytest.mark.not_on_windows("does not run on windows")
 | 
					pytestmark = [
 | 
				
			||||||
 | 
					    pytest.mark.not_on_windows("does not run on windows"),
 | 
				
			||||||
 | 
					    pytest.mark.usefixtures("mock_modules_root"),
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.mark.usefixtures("config", "mock_packages", "mock_module_filename")
 | 
					@pytest.mark.usefixtures("config", "mock_packages", "mock_module_filename")
 | 
				
			||||||
@@ -279,7 +282,7 @@ def test_projections_all(self, factory, module_configuration):
 | 
				
			|||||||
        projection = writer.spec.format(writer.conf.projections["all"])
 | 
					        projection = writer.spec.format(writer.conf.projections["all"])
 | 
				
			||||||
        assert projection in writer.layout.use_name
 | 
					        assert projection in writer.layout.use_name
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_invalid_naming_scheme(self, factory, module_configuration, mock_module_filename):
 | 
					    def test_invalid_naming_scheme(self, factory, module_configuration):
 | 
				
			||||||
        """Tests the evaluation of an invalid naming scheme."""
 | 
					        """Tests the evaluation of an invalid naming scheme."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        module_configuration("invalid_naming_scheme")
 | 
					        module_configuration("invalid_naming_scheme")
 | 
				
			||||||
@@ -290,7 +293,7 @@ def test_invalid_naming_scheme(self, factory, module_configuration, mock_module_
 | 
				
			|||||||
        with pytest.raises(RuntimeError):
 | 
					        with pytest.raises(RuntimeError):
 | 
				
			||||||
            writer.layout.use_name
 | 
					            writer.layout.use_name
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_invalid_token_in_env_name(self, factory, module_configuration, mock_module_filename):
 | 
					    def test_invalid_token_in_env_name(self, factory, module_configuration):
 | 
				
			||||||
        """Tests setting environment variables with an invalid name."""
 | 
					        """Tests setting environment variables with an invalid name."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        module_configuration("invalid_token_in_env_var_name")
 | 
					        module_configuration("invalid_token_in_env_var_name")
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user