Skip to content

Commit d650bbb

Browse files
author
Vasileios Karakasis
authored
Merge pull request #2459 from ekouts/docs/deps_init_hook
[doc] Modernize test syntax in the test dependencies docs
2 parents ca9ebfd + f3ddf82 commit d650bbb

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

docs/dependencies.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ This can be expressed inside :class:`T1` using the :func:`depends_on` method:
2424
valid_systems = ['P0', 'P1']
2525
valid_prog_environs = ['E0', 'E1']
2626
27-
def __init__(self):
27+
@run_after('init')
28+
def setup_deps(self):
2829
self.depends_on('T0')
2930
3031
Conceptually, this dependency can be viewed at the test level as follows:
@@ -58,8 +59,9 @@ You can achieve this as follows:
5859
5960
@rfm.simple_test
6061
class T1(rfm.RegressionTest):
61-
def __init__(self):
62-
...
62+
...
63+
@run_after('init')
64+
def setup_deps(self):
6365
self.depends_on('T0', how=udeps.fully)
6466
6567
@@ -154,8 +156,9 @@ The following code will create dependencies only if the source partition is ``P0
154156
155157
@rfm.simple_test
156158
class T1(rfm.RegressionTest):
157-
def __init__(self):
158-
...
159+
...
160+
@run_after('init')
161+
def setup_deps(self):
159162
self.depends_on('T0', how=myway)
160163
161164

0 commit comments

Comments
 (0)