#NEWLINE# def test_subqueryload_on_subclass( self ) : #NEWLINE# #INDENT# sess = create_session ( ) #NEWLINE# expected = [ Engineer ( name = 'dilbert' , engineer_name = 'dilbert' , primary_language = 'java' , status = 'regular engineer' , machines = [ Machine ( name = 'IBM ThinkPad' ) , Machine ( name = 'IPhone' ) ] ) ] #NEWLINE# def go( ) : #NEWLINE# #INDENT# eq_ ( sess . query ( Person ) . with_polymorphic ( '*' ) . options ( subqueryload ( Engineer . machines ) ) . filter ( ( Person . name == 'dilbert' ) ) . all ( ) , expected ) #NEWLINE# #UNINDENT# self . assert_sql_count ( testing . db , sess , 2 )