Renamed 'patch_configuration' fixture to 'module_configuration'

This just because the fixture has been moved one level above the one
it was originally defined. In this more general context there's more
than one configuration file that could be patched for tests.
This commit is contained in:
Massimiliano Culpo 2018-04-12 15:44:25 +02:00 committed by Todd Gamblin
parent 008f171a7e
commit ff83003eaf
5 changed files with 79 additions and 78 deletions

View File

@ -28,12 +28,15 @@
import spack.main import spack.main
import spack.modules import spack.modules
import spack.spec
lmod = spack.main.SpackCommand('lmod') lmod = spack.main.SpackCommand('lmod')
# Needed to make the fixture work # Needed to make the fixture work
writer_cls = spack.modules.lmod.LmodModulefileWriter writer_cls = spack.modules.lmod.LmodModulefileWriter
# TODO : add tests for loads and find to check the prompt format
@pytest.fixture( @pytest.fixture(
params=[ params=[
@ -47,26 +50,23 @@ def failure_args(request):
return request.param return request.param
# TODO : test the --delete-tree option
# TODO : this requires having a separate directory for test modules
# TODO : add tests for loads and find to check the prompt format
def test_exit_with_failure(database, failure_args): def test_exit_with_failure(database, failure_args):
with pytest.raises(spack.main.SpackCommandError): with pytest.raises(spack.main.SpackCommandError):
lmod(*failure_args) lmod(*failure_args)
def test_setdefault_command(refresh_db_on_exit, database, patch_configuration): def test_setdefault_command(
mutable_database, module_configuration
):
patch_configuration('autoload_direct') module_configuration('autoload_direct')
# Install two different versions of a package # Install two different versions of a package
other_spec, preferred = 'a@1.0', 'a@2.0' other_spec, preferred = 'a@1.0', 'a@2.0'
database.install(preferred)
database.install(other_spec)
writer_cls = spack.modules.module_types['lmod'] spack.spec.Spec(other_spec).concretized().package.do_install(fake=True)
spack.spec.Spec(preferred).concretized().package.do_install(fake=True)
writers = { writers = {
preferred: writer_cls(spack.spec.Spec(preferred).concretized()), preferred: writer_cls(spack.spec.Spec(preferred).concretized()),
other_spec: writer_cls(spack.spec.Spec(other_spec).concretized()) other_spec: writer_cls(spack.spec.Spec(other_spec).concretized())
@ -87,7 +87,7 @@ def test_setdefault_command(refresh_db_on_exit, database, patch_configuration):
# Set the default to be the other spec # Set the default to be the other spec
lmod('setdefault', other_spec) lmod('setdefault', other_spec)
# Check that a link named default exists, and points to the right file # Check that a link named 'default' exists, and points to the right file
for k in preferred, other_spec: for k in preferred, other_spec:
assert os.path.exists(writers[k].layout.filename) assert os.path.exists(writers[k].layout.filename)
assert os.path.exists(link_name) and os.path.islink(link_name) assert os.path.exists(link_name) and os.path.islink(link_name)
@ -96,7 +96,7 @@ def test_setdefault_command(refresh_db_on_exit, database, patch_configuration):
# Reset the default to be the preferred spec # Reset the default to be the preferred spec
lmod('setdefault', preferred) lmod('setdefault', preferred)
# Check that a link named default exists, and points to the right file # Check that a link named 'default' exists, and points to the right file
for k in preferred, other_spec: for k in preferred, other_spec:
assert os.path.exists(writers[k].layout.filename) assert os.path.exists(writers[k].layout.filename)
assert os.path.exists(link_name) and os.path.islink(link_name) assert os.path.exists(link_name) and os.path.islink(link_name)

View File

@ -33,6 +33,7 @@
import ordereddict_backport import ordereddict_backport
import py import py
import pytest import pytest
import yaml
from llnl.util.filesystem import remove_linked_tree from llnl.util.filesystem import remove_linked_tree
@ -407,9 +408,9 @@ def fake_fn(self):
@pytest.fixture() @pytest.fixture()
def patch_configuration(monkeypatch, request): def module_configuration(monkeypatch, request):
"""Reads a configuration file from the mock ones prepared for tests """Reads the module configuration file from the mock ones prepared
and monkeypatches the right classes to hook it in. for tests and monkeypatches the right classes to hook it in.
""" """
# Class of the module file writer # Class of the module file writer
writer_cls = getattr(request.module, 'writer_cls') writer_cls = getattr(request.module, 'writer_cls')
@ -419,7 +420,7 @@ def patch_configuration(monkeypatch, request):
writer_key = str(writer_mod.__name__).split('.')[-1] writer_key = str(writer_mod.__name__).split('.')[-1]
# Root folder for configuration # Root folder for configuration
root_for_conf = os.path.join( root_for_conf = os.path.join(
spack.test_path, 'data', 'modules', writer_key spack.paths.test_path, 'data', 'modules', writer_key
) )
def _impl(filename): def _impl(filename):

View File

@ -33,12 +33,12 @@
@pytest.mark.usefixtures('config', 'mock_packages') @pytest.mark.usefixtures('config', 'mock_packages')
class TestDotkit(object): class TestDotkit(object):
def test_dotkit(self, modulefile_content, patch_configuration): def test_dotkit(self, modulefile_content, module_configuration):
"""Tests the generation of a dotkit file that loads dependencies """Tests the generation of a dotkit file that loads dependencies
automatically. automatically.
""" """
patch_configuration('autoload_direct') module_configuration('autoload_direct')
content = modulefile_content('mpileaks arch=x86-linux') content = modulefile_content('mpileaks arch=x86-linux')
assert '#c spack' in content assert '#c spack' in content
@ -46,21 +46,21 @@ def test_dotkit(self, modulefile_content, patch_configuration):
assert len([x for x in content if 'dk_op' in x]) == 2 assert len([x for x in content if 'dk_op' in x]) == 2
def test_override_template_in_package( def test_override_template_in_package(
self, modulefile_content, patch_configuration self, modulefile_content, module_configuration
): ):
"""Tests overriding a template from and attribute in the package.""" """Tests overriding a template from and attribute in the package."""
patch_configuration('autoload_direct') module_configuration('autoload_direct')
content = modulefile_content('override-module-templates') content = modulefile_content('override-module-templates')
assert 'Override successful!' in content assert 'Override successful!' in content
def test_override_template_in_modules_yaml( def test_override_template_in_modules_yaml(
self, modulefile_content, patch_configuration self, modulefile_content, module_configuration
): ):
"""Tests overriding a template from `modules.yaml`""" """Tests overriding a template from `modules.yaml`"""
patch_configuration('override_template') module_configuration('override_template')
# Check that this takes precedence over an attribute in the package # Check that this takes precedence over an attribute in the package
content = modulefile_content('override-module-templates') content = modulefile_content('override-module-templates')

View File

@ -56,10 +56,10 @@ def provider(request):
class TestLmod(object): class TestLmod(object):
def test_file_layout( def test_file_layout(
self, compiler, provider, factory, patch_configuration self, compiler, provider, factory, module_configuration
): ):
"""Tests the layout of files in the hierarchy is the one expected.""" """Tests the layout of files in the hierarchy is the one expected."""
patch_configuration('complex_hierarchy') module_configuration('complex_hierarchy')
spec_string, services = provider spec_string, services = provider
module, spec = factory(spec_string + '%' + compiler) module, spec = factory(spec_string + '%' + compiler)
@ -91,10 +91,10 @@ def test_file_layout(
else: else:
assert repetitions == 1 assert repetitions == 1
def test_simple_case(self, modulefile_content, patch_configuration): def test_simple_case(self, modulefile_content, module_configuration):
"""Tests the generation of a simple TCL module file.""" """Tests the generation of a simple TCL module file."""
patch_configuration('autoload_direct') module_configuration('autoload_direct')
content = modulefile_content(mpich_spec_string) content = modulefile_content(mpich_spec_string)
assert '-- -*- lua -*-' in content assert '-- -*- lua -*-' in content
@ -102,10 +102,10 @@ def test_simple_case(self, modulefile_content, patch_configuration):
assert 'whatis([[Version : 3.0.4]])' in content assert 'whatis([[Version : 3.0.4]])' in content
assert 'family("mpi")' in content assert 'family("mpi")' in content
def test_autoload_direct(self, modulefile_content, patch_configuration): def test_autoload_direct(self, modulefile_content, module_configuration):
"""Tests the automatic loading of direct dependencies.""" """Tests the automatic loading of direct dependencies."""
patch_configuration('autoload_direct') module_configuration('autoload_direct')
content = modulefile_content(mpileaks_spec_string) content = modulefile_content(mpileaks_spec_string)
assert len([x for x in content if 'if not isloaded(' in x]) == 2 assert len([x for x in content if 'if not isloaded(' in x]) == 2
@ -116,10 +116,10 @@ def test_autoload_direct(self, modulefile_content, patch_configuration):
messages = [x for x in content if 'LmodMessage("Autoloading' in x] messages = [x for x in content if 'LmodMessage("Autoloading' in x]
assert len(messages) == 0 assert len(messages) == 0
def test_autoload_all(self, modulefile_content, patch_configuration): def test_autoload_all(self, modulefile_content, module_configuration):
"""Tests the automatic loading of all dependencies.""" """Tests the automatic loading of all dependencies."""
patch_configuration('autoload_all') module_configuration('autoload_all')
content = modulefile_content(mpileaks_spec_string) content = modulefile_content(mpileaks_spec_string)
assert len([x for x in content if 'if not isloaded(' in x]) == 5 assert len([x for x in content if 'if not isloaded(' in x]) == 5
@ -129,10 +129,10 @@ def test_autoload_all(self, modulefile_content, patch_configuration):
messages = [x for x in content if 'LmodMessage("Autoloading' in x] messages = [x for x in content if 'LmodMessage("Autoloading' in x]
assert len(messages) == 5 assert len(messages) == 5
def test_alter_environment(self, modulefile_content, patch_configuration): def test_alter_environment(self, modulefile_content, module_configuration):
"""Tests modifications to run-time environment.""" """Tests modifications to run-time environment."""
patch_configuration('alter_environment') module_configuration('alter_environment')
content = modulefile_content('mpileaks platform=test target=x86_64') content = modulefile_content('mpileaks platform=test target=x86_64')
assert len( assert len(
@ -151,22 +151,22 @@ def test_alter_environment(self, modulefile_content, patch_configuration):
assert len([x for x in content if 'setenv("FOO", "foo")' in x]) == 0 assert len([x for x in content if 'setenv("FOO", "foo")' in x]) == 0
assert len([x for x in content if 'unsetenv("BAR")' in x]) == 0 assert len([x for x in content if 'unsetenv("BAR")' in x]) == 0
def test_blacklist(self, modulefile_content, patch_configuration): def test_blacklist(self, modulefile_content, module_configuration):
"""Tests blacklisting the generation of selected modules.""" """Tests blacklisting the generation of selected modules."""
patch_configuration('blacklist') module_configuration('blacklist')
content = modulefile_content(mpileaks_spec_string) content = modulefile_content(mpileaks_spec_string)
assert len([x for x in content if 'if not isloaded(' in x]) == 1 assert len([x for x in content if 'if not isloaded(' in x]) == 1
assert len([x for x in content if 'load(' in x]) == 1 assert len([x for x in content if 'load(' in x]) == 1
def test_no_hash(self, factory, patch_configuration): def test_no_hash(self, factory, module_configuration):
"""Makes sure that virtual providers (in the hierarchy) always """Makes sure that virtual providers (in the hierarchy) always
include a hash. Make sure that the module file for the spec include a hash. Make sure that the module file for the spec
does not include a hash if hash_length is 0. does not include a hash if hash_length is 0.
""" """
patch_configuration('no_hash') module_configuration('no_hash')
module, spec = factory(mpileaks_spec_string) module, spec = factory(mpileaks_spec_string)
path = module.layout.filename path = module.layout.filename
mpi_spec = spec['mpi'] mpi_spec = spec['mpi']
@ -184,50 +184,50 @@ def test_no_hash(self, factory, patch_configuration):
assert path.endswith(mpileaks_element) assert path.endswith(mpileaks_element)
def test_no_core_compilers(self, factory, patch_configuration): def test_no_core_compilers(self, factory, module_configuration):
"""Ensures that missing 'core_compilers' in the configuration file """Ensures that missing 'core_compilers' in the configuration file
raises the right exception. raises the right exception.
""" """
# In this case we miss the entry completely # In this case we miss the entry completely
patch_configuration('missing_core_compilers') module_configuration('missing_core_compilers')
module, spec = factory(mpileaks_spec_string) module, spec = factory(mpileaks_spec_string)
with pytest.raises(spack.modules.lmod.CoreCompilersNotFoundError): with pytest.raises(spack.modules.lmod.CoreCompilersNotFoundError):
module.write() module.write()
# Here we have an empty list # Here we have an empty list
patch_configuration('core_compilers_empty') module_configuration('core_compilers_empty')
module, spec = factory(mpileaks_spec_string) module, spec = factory(mpileaks_spec_string)
with pytest.raises(spack.modules.lmod.CoreCompilersNotFoundError): with pytest.raises(spack.modules.lmod.CoreCompilersNotFoundError):
module.write() module.write()
def test_non_virtual_in_hierarchy(self, factory, patch_configuration): def test_non_virtual_in_hierarchy(self, factory, module_configuration):
"""Ensures that if a non-virtual is in hierarchy, an exception will """Ensures that if a non-virtual is in hierarchy, an exception will
be raised. be raised.
""" """
patch_configuration('non_virtual_in_hierarchy') module_configuration('non_virtual_in_hierarchy')
module, spec = factory(mpileaks_spec_string) module, spec = factory(mpileaks_spec_string)
with pytest.raises(spack.modules.lmod.NonVirtualInHierarchyError): with pytest.raises(spack.modules.lmod.NonVirtualInHierarchyError):
module.write() module.write()
def test_override_template_in_package( def test_override_template_in_package(
self, modulefile_content, patch_configuration self, modulefile_content, module_configuration
): ):
"""Tests overriding a template from and attribute in the package.""" """Tests overriding a template from and attribute in the package."""
patch_configuration('autoload_direct') module_configuration('autoload_direct')
content = modulefile_content('override-module-templates') content = modulefile_content('override-module-templates')
assert 'Override successful!' in content assert 'Override successful!' in content
def test_override_template_in_modules_yaml( def test_override_template_in_modules_yaml(
self, modulefile_content, patch_configuration self, modulefile_content, module_configuration
): ):
"""Tests overriding a template from `modules.yaml`""" """Tests overriding a template from `modules.yaml`"""
patch_configuration('override_template') module_configuration('override_template')
content = modulefile_content('override-module-templates') content = modulefile_content('override-module-templates')
assert 'Override even better!' in content assert 'Override even better!' in content

View File

@ -39,18 +39,18 @@
@pytest.mark.usefixtures('config', 'mock_packages') @pytest.mark.usefixtures('config', 'mock_packages')
class TestTcl(object): class TestTcl(object):
def test_simple_case(self, modulefile_content, patch_configuration): def test_simple_case(self, modulefile_content, module_configuration):
"""Tests the generation of a simple TCL module file.""" """Tests the generation of a simple TCL module file."""
patch_configuration('autoload_direct') module_configuration('autoload_direct')
content = modulefile_content(mpich_spec_string) content = modulefile_content(mpich_spec_string)
assert 'module-whatis "mpich @3.0.4"' in content assert 'module-whatis "mpich @3.0.4"' in content
def test_autoload_direct(self, modulefile_content, patch_configuration): def test_autoload_direct(self, modulefile_content, module_configuration):
"""Tests the automatic loading of direct dependencies.""" """Tests the automatic loading of direct dependencies."""
patch_configuration('autoload_direct') module_configuration('autoload_direct')
content = modulefile_content(mpileaks_spec_string) content = modulefile_content(mpileaks_spec_string)
assert len([x for x in content if 'is-loaded' in x]) == 2 assert len([x for x in content if 'is-loaded' in x]) == 2
@ -70,10 +70,10 @@ def test_autoload_direct(self, modulefile_content, patch_configuration):
messages = [x for x in content if 'puts stderr "Autoloading' in x] messages = [x for x in content if 'puts stderr "Autoloading' in x]
assert len(messages) == 0 assert len(messages) == 0
def test_autoload_all(self, modulefile_content, patch_configuration): def test_autoload_all(self, modulefile_content, module_configuration):
"""Tests the automatic loading of all dependencies.""" """Tests the automatic loading of all dependencies."""
patch_configuration('autoload_all') module_configuration('autoload_all')
content = modulefile_content(mpileaks_spec_string) content = modulefile_content(mpileaks_spec_string)
assert len([x for x in content if 'is-loaded' in x]) == 5 assert len([x for x in content if 'is-loaded' in x]) == 5
@ -94,27 +94,27 @@ def test_autoload_all(self, modulefile_content, patch_configuration):
assert len(messages) == 2 assert len(messages) == 2
def test_prerequisites_direct( def test_prerequisites_direct(
self, modulefile_content, patch_configuration self, modulefile_content, module_configuration
): ):
"""Tests asking direct dependencies as prerequisites.""" """Tests asking direct dependencies as prerequisites."""
patch_configuration('prerequisites_direct') module_configuration('prerequisites_direct')
content = modulefile_content('mpileaks arch=x86-linux') content = modulefile_content('mpileaks arch=x86-linux')
assert len([x for x in content if 'prereq' in x]) == 2 assert len([x for x in content if 'prereq' in x]) == 2
def test_prerequisites_all(self, modulefile_content, patch_configuration): def test_prerequisites_all(self, modulefile_content, module_configuration):
"""Tests asking all dependencies as prerequisites.""" """Tests asking all dependencies as prerequisites."""
patch_configuration('prerequisites_all') module_configuration('prerequisites_all')
content = modulefile_content('mpileaks arch=x86-linux') content = modulefile_content('mpileaks arch=x86-linux')
assert len([x for x in content if 'prereq' in x]) == 5 assert len([x for x in content if 'prereq' in x]) == 5
def test_alter_environment(self, modulefile_content, patch_configuration): def test_alter_environment(self, modulefile_content, module_configuration):
"""Tests modifications to run-time environment.""" """Tests modifications to run-time environment."""
patch_configuration('alter_environment') module_configuration('alter_environment')
content = modulefile_content('mpileaks platform=test target=x86_64') content = modulefile_content('mpileaks platform=test target=x86_64')
assert len([x for x in content assert len([x for x in content
@ -143,10 +143,10 @@ def test_alter_environment(self, modulefile_content, patch_configuration):
assert len([x for x in content if 'module load foo/bar' in x]) == 1 assert len([x for x in content if 'module load foo/bar' in x]) == 1
assert len([x for x in content if 'setenv LIBDWARF_ROOT' in x]) == 1 assert len([x for x in content if 'setenv LIBDWARF_ROOT' in x]) == 1
def test_blacklist(self, modulefile_content, patch_configuration): def test_blacklist(self, modulefile_content, module_configuration):
"""Tests blacklisting the generation of selected modules.""" """Tests blacklisting the generation of selected modules."""
patch_configuration('blacklist') module_configuration('blacklist')
content = modulefile_content('mpileaks ^zmpi') content = modulefile_content('mpileaks ^zmpi')
assert len([x for x in content if 'is-loaded' in x]) == 1 assert len([x for x in content if 'is-loaded' in x]) == 1
@ -161,12 +161,12 @@ def test_blacklist(self, modulefile_content, patch_configuration):
assert len([x for x in content if 'is-loaded' in x]) == 1 assert len([x for x in content if 'is-loaded' in x]) == 1
assert len([x for x in content if 'module load ' in x]) == 1 assert len([x for x in content if 'module load ' in x]) == 1
def test_naming_scheme(self, factory, patch_configuration): def test_naming_scheme(self, factory, module_configuration):
"""Tests reading the correct naming scheme.""" """Tests reading the correct naming scheme."""
# This configuration has no error, so check the conflicts directives # This configuration has no error, so check the conflicts directives
# are there # are there
patch_configuration('conflicts') module_configuration('conflicts')
# Test we read the expected configuration for the naming scheme # Test we read the expected configuration for the naming scheme
writer, _ = factory('mpileaks') writer, _ = factory('mpileaks')
@ -174,10 +174,10 @@ def test_naming_scheme(self, factory, patch_configuration):
assert writer.conf.naming_scheme == expected assert writer.conf.naming_scheme == expected
def test_invalid_naming_scheme(self, factory, patch_configuration): 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."""
patch_configuration('invalid_naming_scheme') module_configuration('invalid_naming_scheme')
# Test that having invalid tokens in the naming scheme raises # Test that having invalid tokens in the naming scheme raises
# a RuntimeError # a RuntimeError
@ -185,21 +185,21 @@ def test_invalid_naming_scheme(self, factory, patch_configuration):
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, patch_configuration): 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."""
patch_configuration('invalid_token_in_env_var_name') module_configuration('invalid_token_in_env_var_name')
writer, _ = factory('mpileaks') writer, _ = factory('mpileaks')
with pytest.raises(RuntimeError): with pytest.raises(RuntimeError):
writer.write() writer.write()
def test_conflicts(self, modulefile_content, patch_configuration): def test_conflicts(self, modulefile_content, module_configuration):
"""Tests adding conflicts to the module.""" """Tests adding conflicts to the module."""
# This configuration has no error, so check the conflicts directives # This configuration has no error, so check the conflicts directives
# are there # are there
patch_configuration('conflicts') module_configuration('conflicts')
content = modulefile_content('mpileaks') content = modulefile_content('mpileaks')
assert len([x for x in content if x.startswith('conflict')]) == 2 assert len([x for x in content if x.startswith('conflict')]) == 2
@ -207,13 +207,13 @@ def test_conflicts(self, modulefile_content, patch_configuration):
assert len([x for x in content if x == 'conflict intel/14.0.1']) == 1 assert len([x for x in content if x == 'conflict intel/14.0.1']) == 1
# This configuration is inconsistent, check an error is raised # This configuration is inconsistent, check an error is raised
patch_configuration('wrong_conflicts') module_configuration('wrong_conflicts')
with pytest.raises(SystemExit): with pytest.raises(SystemExit):
modulefile_content('mpileaks') modulefile_content('mpileaks')
def test_suffixes(self, patch_configuration, factory): def test_suffixes(self, module_configuration, factory):
"""Tests adding suffixes to module file name.""" """Tests adding suffixes to module file name."""
patch_configuration('suffix') module_configuration('suffix')
writer, spec = factory('mpileaks+debug arch=x86-linux') writer, spec = factory('mpileaks+debug arch=x86-linux')
assert 'foo' in writer.layout.use_name assert 'foo' in writer.layout.use_name
@ -221,10 +221,10 @@ def test_suffixes(self, patch_configuration, factory):
writer, spec = factory('mpileaks~debug arch=x86-linux') writer, spec = factory('mpileaks~debug arch=x86-linux')
assert 'bar' in writer.layout.use_name assert 'bar' in writer.layout.use_name
def test_setup_environment(self, modulefile_content, patch_configuration): def test_setup_environment(self, modulefile_content, module_configuration):
"""Tests the internal set-up of run-time environment.""" """Tests the internal set-up of run-time environment."""
patch_configuration('suffix') module_configuration('suffix')
content = modulefile_content('mpileaks') content = modulefile_content('mpileaks')
assert len([x for x in content if 'setenv FOOBAR' in x]) == 1 assert len([x for x in content if 'setenv FOOBAR' in x]) == 1
@ -242,20 +242,20 @@ def test_setup_environment(self, modulefile_content, patch_configuration):
) == 1 ) == 1
def test_override_template_in_package( def test_override_template_in_package(
self, modulefile_content, patch_configuration self, modulefile_content, module_configuration
): ):
"""Tests overriding a template from and attribute in the package.""" """Tests overriding a template from and attribute in the package."""
patch_configuration('autoload_direct') module_configuration('autoload_direct')
content = modulefile_content('override-module-templates') content = modulefile_content('override-module-templates')
assert 'Override successful!' in content assert 'Override successful!' in content
def test_override_template_in_modules_yaml( def test_override_template_in_modules_yaml(
self, modulefile_content, patch_configuration self, modulefile_content, module_configuration
): ):
"""Tests overriding a template from `modules.yaml`""" """Tests overriding a template from `modules.yaml`"""
patch_configuration('override_template') module_configuration('override_template')
content = modulefile_content('override-module-templates') content = modulefile_content('override-module-templates')
assert 'Override even better!' in content assert 'Override even better!' in content
@ -264,10 +264,10 @@ def test_override_template_in_modules_yaml(
assert 'Override even better!' in content assert 'Override even better!' in content
def test_extend_context( def test_extend_context(
self, modulefile_content, patch_configuration self, modulefile_content, module_configuration
): ):
"""Tests using a package defined context""" """Tests using a package defined context"""
patch_configuration('autoload_direct') module_configuration('autoload_direct')
content = modulefile_content('override-context-templates') content = modulefile_content('override-context-templates')
assert 'puts stderr "sentence from package"' in content assert 'puts stderr "sentence from package"' in content