1818import reframe .utility .osext as osext
1919from reframe .core .exceptions import NameConflictError , is_severe , what
2020from reframe .core .logging import getlogger
21- from reframe .core .fixtures import FixtureRegistry
2221
2322
2423class RegressionCheckValidator (ast .NodeVisitor ):
@@ -171,7 +170,7 @@ def load_from_module(self, module):
171170 return []
172171
173172 self ._set_defaults (registry )
174- test_pool = registry .instantiate_all () if registry else []
173+ candidate_tests = registry .instantiate_all () if registry else []
175174 legacy_tests = legacy_registry () if legacy_registry else []
176175 if self ._external_vars and legacy_tests :
177176 getlogger ().warning (
@@ -180,32 +179,11 @@ def load_from_module(self, module):
180179 "please use the 'parameter' builtin in your tests"
181180 )
182181
183- # Merge registries
184- test_pool += legacy_tests
185-
186- # Do a level-order traversal of the fixture registries of all tests in
187- # the test pool, instantiate all fixtures and generate the final set
188- # of candidate tests to load; the test pool is consumed at the end of
189- # the traversal and all instantiated tests (including fixtures) are
190- # stored in `candidate_tests`.
191- candidate_tests = []
192- fixture_registry = FixtureRegistry ()
193- while test_pool :
194- tmp_registry = FixtureRegistry ()
195- while test_pool :
196- c = test_pool .pop ()
197- reg = getattr (c , '_rfm_fixture_registry' , None )
198- candidate_tests .append (c )
199- if reg :
200- tmp_registry .update (reg )
201-
202- # Instantiate the new fixtures and update the registry
203- new_fixtures = tmp_registry .difference (fixture_registry )
204- test_pool = new_fixtures .instantiate_all ()
205- fixture_registry .update (new_fixtures )
182+ # Merge tests
183+ candidate_tests += legacy_tests
206184
207185 # Post-instantiation validation of the candidate tests
208- tests = []
186+ final_tests = []
209187 for c in candidate_tests :
210188 if not isinstance (c , RegressionTest ):
211189 continue
@@ -218,15 +196,15 @@ def load_from_module(self, module):
218196 conflicted = self ._loaded [c .unique_name ]
219197 except KeyError :
220198 self ._loaded [c .unique_name ] = testfile
221- tests .append (c )
199+ final_tests .append (c )
222200 else :
223201 raise NameConflictError (
224202 f'test { c .unique_name !r} from { testfile !r} '
225203 f'is already defined in { conflicted !r} '
226204 )
227205
228- getlogger ().debug (f' > Loaded { len (tests )} test(s)' )
229- return tests
206+ getlogger ().debug (f' > Loaded { len (final_tests )} test(s)' )
207+ return final_tests
230208
231209 def load_from_file (self , filename , force = False ):
232210 if not self ._validate_source (filename ):
0 commit comments