class_docstr: test for [ticket:2885]
class_docstr_tok: ["test","for","[","ticket:2885","]"]
code: def test_map_to_select(self):
      Base, Child = self.classes.Base, self.classes.Child
      base, child = self.tables.base, self.tables.child
  
      base_select = select(base).alias()
      self.mapper_registry.map_imperatively(
          Base,
          base_select,
          polymorphic_on=base_select.c.type,
          polymorphic_identity="base",
      )
      self.mapper_registry.map_imperatively(
          Child, child, inherits=Base, polymorphic_identity="child"
      )
  
      sess = fixture_session()
  
      # 2. use an id other than "1" here so can't rely on
      # the two inserts having the same id
      c1 = Child(id=12, name="c1")
      sess.add(c1)
  
      sess.commit()
      sess.close()
  
      c1 = sess.query(Child).one()
      eq_(c1.name, "c1")
  
file_path: sqlalchemy/test/orm/inheritance/test_selects.py
imports: from sqlalchemy import ForeignKey
  from sqlalchemy import Integer
  from sqlalchemy import select
  from sqlalchemy import String
  from sqlalchemy.orm import Session
  from sqlalchemy.testing import eq_
  from sqlalchemy.testing import fixtures
  from sqlalchemy.testing.entities import ComparableEntity
  from sqlalchemy.testing.fixtures import fixture_session
  from sqlalchemy.testing.schema import Column
  from sqlalchemy.testing.schema import Table
label_desc: Use image node_id 3 for calling the JoinFromSelectPersistenceTest obj's underlying member method code with example usage: obj.test_map_to_select() without return types