22
33import pytest
44
5- from pyoracle_forms import Module , Item , DataBlock , Canvas , Window , initialize_context
5+ from pyoracle_forms import (
6+ Module ,
7+ Item ,
8+ DataBlock ,
9+ Canvas ,
10+ Window ,
11+ initialize_context ,
12+ PropertyClass ,
13+ )
614from pyoracle_forms import context as ctx
715
816
@@ -25,10 +33,21 @@ def data_block(module):
2533
2634
2735@pytest .fixture (scope = "session" )
28- def item (data_block ):
36+ def item (data_block ) -> Item :
2937 return data_block .items [0 ]
3038
3139
40+ @pytest .fixture (scope = "session" )
41+ def property_classes (module ) -> [PropertyClass ]:
42+ return module .property_classes
43+
44+
45+ @pytest .fixture (scope = "session" )
46+ def property_class (property_classes ) -> PropertyClass :
47+ assert property_classes
48+ return property_classes [0 ]
49+
50+
3251@pytest .fixture (scope = "session" )
3352def canvas (module ):
3453 return module .canvases [0 ]
@@ -92,3 +111,10 @@ def new_data_block(make_data_block):
92111@pytest .fixture (scope = "function" )
93112def new_item (new_data_block , make_item ):
94113 return make_item (new_data_block , "ITM" )
114+
115+
116+ @pytest .fixture (scope = "function" )
117+ def subclassed_item (new_data_block , make_item , property_class ):
118+ item = make_item (new_data_block , "ITM" )
119+ item .subclass (property_class )
120+ return item
0 commit comments