def test_future_altaz():
 from ...utils.exceptions import AstropyWarning
 from ..builtin_frames import utils
 if hasattr(utils, u'__warningregistry__'):
  utils.__warningregistry__.clear()
 with catch_warnings() as found_warnings:
  location = EarthLocation(lat=(0 * u.deg), lon=(0 * u.deg))
  t = Time(u'J2161')
  SkyCoord((1 * u.deg), (2 * u.deg)).transform_to(AltAz(location=location, obstime=t))
 messages_to_find = [u'Tried to get polar motions for times after IERS data is valid.']
 if isinstance(iers.IERS_Auto.iers_table, iers.IERS_B):
  messages_to_find.append(u'(some) times are outside of range covered by IERS table.')
 messages_found = [False for _ in messages_to_find]
 for w in found_warnings:
  if issubclass(w.category, AstropyWarning):
   for (i, message_to_find) in enumerate(messages_to_find):
    if (message_to_find in str(w.message)):
     messages_found[i] = True
 assert all(messages_found)

def test_future_altaz ( ) : from ... utils . exceptions import AstropyWarning from . . builtin_frames import utils if hasattr ( utils , u'__warningregistry__' ) : utils . __warningregistry__ . clear ( ) with catch_warnings ( ) as found_warnings : location = EarthLocation ( lat = ( 0 * u . deg ) , lon = ( 0 * u . deg ) ) t = Time ( u'J2161' ) SkyCoord ( ( 1 * u . deg ) , ( 2 * u . deg ) ) . transform_to ( AltAz ( location = location , obstime = t ) ) messages_to_find = [ u'Tried to get polar motions for times after IERS data is valid.' ] if isinstance ( iers . IERS_Auto . iers_table , iers . IERS_B ) : messages_to_find . append ( u'(some) times are outside of range covered by IERS table.' ) messages_found = [ False for _ in messages_to_find ] for w in found_warnings : if issubclass ( w . category , AstropyWarning ) : for ( i , message_to_find ) in enumerate ( messages_to_find ) : if ( message_to_find in str ( w . message ) ) : messages_found [ i ] = True assert all ( messages_found )
while this does test the full stack .