@@ -53,7 +53,6 @@ def _get_class(cls: type) -> schema.Class:
5353 # getattr to inherit from bases
5454 group = getattr (cls , "_group" , "" ),
5555 hideable = getattr (cls , "_hideable" , False ),
56- test_with = _get_name (getattr (cls , "_test_with" , None )),
5756 pragmas = pragmas ,
5857 # in the following we don't use `getattr` to avoid inheriting
5958 properties = [
@@ -123,9 +122,11 @@ def _fill_hideable_information(classes: typing.Dict[str, schema.Class]):
123122
124123def _check_test_with (classes : typing .Dict [str , schema .Class ]):
125124 for cls in classes .values ():
126- if cls .test_with is not None and classes [cls .test_with ].test_with is not None :
127- raise schema .Error (f"{ cls .name } has test_with { cls .test_with } which in turn "
128- f"has test_with { classes [cls .test_with ].test_with } , use that directly" )
125+ test_with = typing .cast (str , cls .pragmas .get ("qltest_test_with" ))
126+ transitive_test_with = test_with and classes [test_with ].pragmas .get ("qltest_test_with" )
127+ if test_with and transitive_test_with :
128+ raise schema .Error (f"{ cls .name } has test_with { test_with } which in turn "
129+ f"has test_with { transitive_test_with } , use that directly" )
129130
130131
131132def load (m : types .ModuleType ) -> schema .Schema :
0 commit comments