-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bugfix] Fix error when more than one instance of the same fixture cl…
…ass are specified
- Loading branch information
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
unittests/resources/checks_unlisted/fixtures_same_class.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright 2016-2024 Swiss National Supercomputing Centre (CSCS/ETH Zurich) | ||
# ReFrame Project Developers. See the top-level LICENSE file for details. | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
import reframe as rfm | ||
import reframe.utility.sanity as sn | ||
|
||
|
||
class HelloFixture(rfm.RunOnlyRegressionTest): | ||
executable = 'echo hello from fixture' | ||
myvar = variable(str) | ||
|
||
@sanity_function | ||
def assert_output(self): | ||
return sn.assert_found(r'hello from fixture', self.stdout) | ||
|
||
|
||
@rfm.simple_test | ||
class TestA(rfm.RunOnlyRegressionTest): | ||
valid_systems = ['*'] | ||
valid_prog_environs = ['*'] | ||
|
||
dep1 = fixture(HelloFixture, scope='environment', variables={'myvar': 'a'}) | ||
dep2 = fixture(HelloFixture, scope='environment', variables={'myvar': 'b'}) | ||
|
||
@run_after('setup') | ||
def after_setup(self): | ||
self.executable = f"echo {self.dep1.myvar} {self.dep2.myvar}" | ||
|
||
@sanity_function | ||
def validate(self): | ||
return sn.assert_found(r'a b', self.stdout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters