diff --git a/reframe/core/pipeline.py b/reframe/core/pipeline.py index 5663f6e11..c7878e427 100644 --- a/reframe/core/pipeline.py +++ b/reframe/core/pipeline.py @@ -1646,7 +1646,9 @@ def _resolve_fixtures(self): # registered under the same fixture class. So the loop below must # also inspect the fixture data the instance was registered with. for fixt_name, fixt_data in registry[f.cls].items(): - if f.scope != fixt_data.scope: + if fixt_data.variables != f.variables: + continue + elif f.scope != fixt_data.scope: continue elif fixt_data.variant_num not in target_variants: continue diff --git a/unittests/resources/checks_unlisted/fixtures_complex.py b/unittests/resources/checks_unlisted/fixtures_complex.py index 53be46f92..d200502b8 100644 --- a/unittests/resources/checks_unlisted/fixtures_complex.py +++ b/unittests/resources/checks_unlisted/fixtures_complex.py @@ -102,3 +102,17 @@ def validate_fixture_resolution(self): ParamFixture.num_variants ) ]) + + +@rfm.simple_test +class TestC(rfm.RunOnlyRegressionTest): + valid_systems = ['*'] + valid_prog_environs = ['*'] + executable = 'echo' + f0 = fixture(SimpleFixture, scope='environment', variables={'data': 10}) + f1 = fixture(SimpleFixture, scope='environment', variables={'data': 20}) + + @sanity_function + def validate_vars(self): + return sn.all([sn.assert_eq(self.f0.data, 10), + sn.assert_eq(self.f1.data, 20)])