From 1f495c69f01b7bd022826ca6583865baf8dc9b75 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Mon, 26 Apr 2021 23:25:48 +0200 Subject: [PATCH 1/2] Remove @parameterized_test decorator --- reframe/core/decorators.py | 46 +----------------------------------- unittests/test_parameters.py | 11 --------- 2 files changed, 1 insertion(+), 56 deletions(-) diff --git a/reframe/core/decorators.py b/reframe/core/decorators.py index f2d69d57b7..505555a9d3 100644 --- a/reframe/core/decorators.py +++ b/reframe/core/decorators.py @@ -8,7 +8,7 @@ # __all__ = [ - 'parameterized_test', 'simple_test', 'required_version', + 'simple_test', 'required_version', 'require_deps', 'run_before', 'run_after' ] @@ -109,50 +109,6 @@ def simple_test(cls): return cls -def parameterized_test(*inst): - '''Class decorator for registering multiple instantiations of a test class. - - The decorated class must derive from - :class:`reframe.core.pipeline.RegressionTest`. This decorator is also - available directly under the :mod:`reframe` module. - - :arg inst: The different instantiations of the test. Each instantiation - argument may be either a sequence or a mapping. - - .. versionadded:: 2.13 - - .. note:: - This decorator does not instantiate any test. It only registers them. - The actual instantiation happens during the loading phase of the test. - - .. deprecated:: 3.6.0 - - Please use the :func:`~reframe.core.pipeline.RegressionTest.parameter` - built-in instead. - - ''' - - warn.user_deprecation_warning( - 'the @parameterized_test decorator is deprecated; ' - 'please use the parameter() built-in instead', - from_version='3.6.0' - ) - - def _do_register(cls): - _validate_test(cls) - if not cls.param_space.is_empty(): - raise ValueError( - f'{cls.__qualname__!r} is already a parameterized test' - ) - - for args in inst: - _register_test(cls, args) - - return cls - - return _do_register - - def required_version(*versions): '''Class decorator for specifying the required ReFrame versions for the following test. diff --git a/unittests/test_parameters.py b/unittests/test_parameters.py index 919b7ab6ae..e27f423f4b 100644 --- a/unittests/test_parameters.py +++ b/unittests/test_parameters.py @@ -164,17 +164,6 @@ class MyTest(ExtendParams): assert test.P2 is not None -@pytest.mark.filterwarnings( - 'ignore::reframe.core.warnings.ReframeDeprecationWarning' -) -def test_parameterized_test_is_incompatible(): - with pytest.raises(ValueError): - @rfm.parameterized_test(['var']) - class MyTest(TwoParams): - def __init__(self, var): - pass - - def test_param_space_clash(): class Spam(rfm.RegressionMixin): P0 = parameter([1]) From 6858d6d3f6c47c4f584fea59dd8c18ab24239013 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Mon, 26 Apr 2021 23:37:32 +0200 Subject: [PATCH 2/2] Remove unused imports --- reframe/core/decorators.py | 1 - 1 file changed, 1 deletion(-) diff --git a/reframe/core/decorators.py b/reframe/core/decorators.py index 505555a9d3..dfb76b82bf 100644 --- a/reframe/core/decorators.py +++ b/reframe/core/decorators.py @@ -20,7 +20,6 @@ import traceback import reframe.utility.osext as osext -import reframe.core.warnings as warn from reframe.core.exceptions import (ReframeSyntaxError, SkipTestError, user_frame)