#NEWLINE# def test_subq_through_related_aliased( self ) : #NEWLINE# #INDENT# Parent = self . classes . Parent #NEWLINE# Base = self . classes . Base #NEWLINE# pa = aliased ( Parent ) #NEWLINE# sess = Session ( ) #NEWLINE# def go( ) : #NEWLINE# #INDENT# eq_ ( sess . query ( pa ) . options ( subqueryload_all ( pa . children , Base . related ) ) . order_by ( pa . data ) . all ( ) , [ p1 , p2 ] ) #NEWLINE# #UNINDENT# self . assert_sql_count ( testing . db , go , 3 )