@@ -85,6 +85,7 @@ class Meta:
8585 # Composite
8686 "composite_prop" ,
8787 # Hybrid
88+ "hybrid_prop_with_doc" ,
8889 "hybrid_prop" ,
8990 "hybrid_prop_str" ,
9091 "hybrid_prop_int" ,
@@ -150,6 +151,12 @@ class Meta:
150151 # "doc" is ignored by hybrid_property
151152 assert hybrid_prop_list .description is None
152153
154+ # hybrid_prop_with_doc
155+ hybrid_prop_with_doc = ReporterType ._meta .fields ['hybrid_prop_with_doc' ]
156+ assert hybrid_prop_with_doc .type == String
157+ # docstring is picked up from hybrid_prop_with_doc
158+ assert hybrid_prop_with_doc .description == "Docstring test"
159+
153160 # relationship
154161 favorite_article_field = ReporterType ._meta .fields ['favorite_article' ]
155162 assert isinstance (favorite_article_field , Dynamic )
@@ -183,6 +190,7 @@ class Meta:
183190 composite_prop = ORMField ()
184191
185192 # hybrid_property
193+ hybrid_prop_with_doc = ORMField (description = 'Overridden' )
186194 hybrid_prop = ORMField (description = 'Overridden' )
187195
188196 # relationships
@@ -210,6 +218,7 @@ class Meta:
210218 "email_v2" ,
211219 "column_prop" ,
212220 "composite_prop" ,
221+ "hybrid_prop_with_doc" ,
213222 "hybrid_prop" ,
214223 "favorite_article" ,
215224 "articles" ,
@@ -250,6 +259,11 @@ class Meta:
250259 assert hybrid_prop_field .description == "Overridden"
251260 assert hybrid_prop_field .deprecation_reason is None
252261
262+ hybrid_prop_with_doc_field = ReporterType ._meta .fields ['hybrid_prop_with_doc' ]
263+ assert hybrid_prop_with_doc_field .type == String
264+ assert hybrid_prop_with_doc_field .description == "Overridden"
265+ assert hybrid_prop_with_doc_field .deprecation_reason is None
266+
253267 column_prop_field_v2 = ReporterType ._meta .fields ['column_prop' ]
254268 assert column_prop_field_v2 .type == String
255269 assert column_prop_field_v2 .description is None
@@ -318,6 +332,7 @@ class Meta:
318332 "email" ,
319333 "favorite_pet_kind" ,
320334 "composite_prop" ,
335+ "hybrid_prop_with_doc" ,
321336 "hybrid_prop" ,
322337 "hybrid_prop_str" ,
323338 "hybrid_prop_int" ,
@@ -432,7 +447,7 @@ class Meta:
432447
433448 assert issubclass (CustomReporterType , ObjectType )
434449 assert CustomReporterType ._meta .model == Reporter
435- assert len (CustomReporterType ._meta .fields ) == 16
450+ assert len (CustomReporterType ._meta .fields ) == 17
436451
437452
438453# Test Custom SQLAlchemyObjectType with Custom Options
0 commit comments