diff --git a/reframe/core/pipeline.py b/reframe/core/pipeline.py index 5cd02efe0a..ef55e5aa4a 100644 --- a/reframe/core/pipeline.py +++ b/reframe/core/pipeline.py @@ -46,10 +46,13 @@ # Dependency kinds #: Constant to be passed as the ``how`` argument of the -#: :func:`RegressionTest.depends_on` method. It denotes that test case +#: :func:`~RegressionTest.depends_on` method. It denotes that test case #: dependencies will be explicitly specified by the user. #: #: This constant is directly available under the :mod:`reframe` module. +#: +#: .. deprecated:: 3.3 +#: Please use a callable as the ``how`` argument. DEPEND_EXACT = 1 #: Constant to be passed as the ``how`` argument of the @@ -58,6 +61,9 @@ #: target test that use the same programming environment. #: #: This constant is directly available under the :mod:`reframe` module. +#: +#: .. deprecated:: 3.3 +#: Please use a callable as the ``how`` argument. DEPEND_BY_ENV = 2 #: Constant to be passed as the ``how`` argument of the @@ -65,6 +71,9 @@ #: this test depends on all the test cases of the target test. #: #: This constant is directly available under the :mod:`reframe` module. +#: +#: .. deprecated:: 3.3 +#: Please use a callable as the ``how`` argument. DEPEND_FULLY = 3 diff --git a/reframe/utility/__init__.py b/reframe/utility/__init__.py index df8eb20d9c..46a96c77b6 100644 --- a/reframe/utility/__init__.py +++ b/reframe/utility/__init__.py @@ -565,10 +565,12 @@ def find_modules(substr, environ_mapping=None): .. code:: python - @rfm.parameterized_test(*find_modules('netcdf')) + @rfm.simple_test class MyTest(rfm.RegressionTest): - def __init__(self, s, e, m): - self.descr = f'{s}, {e}, {m}' + module_info = parameter(find_modules('netcdf')) + + def __init__(self): + s, e, m = self.module_info self.valid_systems = [s] self.valid_prog_environs = [e] self.modules = [m] @@ -583,15 +585,17 @@ def __init__(self, s, e, m): .. code:: python my_find_modules = functools.partial(find_modules, environ_mapping={ - r'.*CrayGNU.*': {'PrgEnv-gnu'}, - r'.*CrayIntel.*': {'PrgEnv-intel'}, - r'.*CrayCCE.*': {'PrgEnv-cray'} + r'.*CrayGNU.*': 'PrgEnv-gnu', + r'.*CrayIntel.*': 'PrgEnv-intel', + r'.*CrayCCE.*': 'PrgEnv-cray' }) - @rfm.parameterized_test(*my_find_modules('GROMACS')) + @rfm.simple_test class MyTest(rfm.RegressionTest): - def __init__(self, s, e, m): - self.descr = f'{s}, {e}, {m}' + module_info = parameter(my_find_modules('GROMACS')) + + def __init__(self): + s, e, m = self.module_info self.valid_systems = [s] self.valid_prog_environs = [e] self.modules = [m]