@@ -90,4 +90,20 @@ def test_annotation_template(annotation_template: AnnotationTemplate, input_reso
9090 [(int , Any ), ((tuple | list , Iterable ), Iterable ), ((str , Sized ), Sized )]
9191)
9292def test_special (input_resource : Any , result : Any ):
93- assert Special [input_resource ] == result
93+ assert Special [input_resource ] == result
94+
95+
96+ @mark .parametrize (
97+ "subgroup, instance, result_of_checking" ,
98+ [
99+ (Subgroup (object , lambda _ : True ), 1 , True ),
100+ (Subgroup (object , lambda _ : True ), None , True ),
101+ (Subgroup (object , lambda _ : False ), 256 , False ),
102+ (Subgroup (int , lambda number : number > 0 ), 5 , True ),
103+ (Subgroup (int , lambda number : number > 0 ), - 42 , False ),
104+ (Subgroup (int , lambda number : number > 0 ), 6.4 , False ),
105+ (Subgroup (int | float , lambda number : number > 0 ), 6.4 , True ),
106+ ]
107+ )
108+ def test_subgroup (subgroup : Subgroup , instance : Any , result_of_checking : bool ):
109+ assert isinstance (instance , subgroup ) is (instance in subgroup ) is result_of_checking
0 commit comments