You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a parameter with a matching name is already present in the parameter space of a parent class, the existing parameter values will be combined with those provided by this method following the inheritance behavior set by the arguments ``inherit_params`` and ``filter_params``.
@@ -67,7 +67,7 @@ In essence, these builtins exert control over the test creation, and they allow
67
67
else:
68
68
do_other()
69
69
70
-
One of the most powerful features about these built-in functions is that they store their input information at the class level.
70
+
One of the most powerful features about these built-in functions is that they store their input information at the class level.
71
71
However, a parameter may only be accessed from the class instance and accessing it directly from the class body is disallowed.
72
72
With this approach, extending or specializing an existing parametrized regression test becomes straightforward, since the test attribute additions and modifications made through built-in functions in the parent class are automatically inherited by the child test.
73
73
For instance, continuing with the example above, one could override the :func:`__init__` method in the :class:`Foo` regression test as follows:
@@ -83,7 +83,7 @@ In essence, these builtins exert control over the test creation, and they allow
83
83
84
84
Note that this built-in parameter function provides an alternative method to parameterize a test to :func:`reframe.core.decorators.parameterized_test`, and the use of both approaches in the same test is currently disallowed.
85
85
The two main advantages of the built-in :func:`parameter` over the decorated approach reside in the parameter inheritance across classes and the handling of large parameter sets.
86
-
As shown in the example above, the parameters declared with the built-in :func:`parameter` are automatically carried over into derived tests through class inheritance, whereas tests using the decorated approach would have to redefine the parameters on every test.
86
+
As shown in the example above, the parameters declared with the built-in :func:`parameter` are automatically carried over into derived tests through class inheritance, whereas tests using the decorated approach would have to redefine the parameters on every test.
87
87
Similarly, parameters declared through the built-in :func:`parameter` are regarded as fully independent from each other and ReFrame will automatically generate as many tests as available parameter combinations. This is a major advantage over the decorated approach, where one would have to manually expand the parameter combinations.
88
88
This is illustrated in the example below, consisting of a case with two parameters, each having two possible values.
89
89
@@ -114,11 +114,11 @@ In essence, these builtins exert control over the test creation, and they allow
114
114
This only has an effect if used with ``inherit_params=True``.
Declaring a test variable through the :func:`variable` built-in allows for a more robust test implementation than if the variables were just defined as regular test attributes (e.g. ``self.a = 10``).
121
-
Using variables declared through the :func:`variable` built-in guarantees that these regression test variables will not be redeclared by any child class, while also ensuring that any values that may be assigned to such variables comply with its original declaration.
121
+
Using variables declared through the :func:`variable` built-in guarantees that these regression test variables will not be redeclared by any child class, while also ensuring that any values that may be assigned to such variables comply with its original declaration.
122
122
In essence, by using test variables, the user removes any potential test errors that might be caused by accidentally overriding a class attribute. See the example below.
0 commit comments