def test_set_format_shares_subfmt():
 t = Time('+02000-02-03', format='fits', out_subfmt='date_hms', precision=5)
 tc = t.copy()
 t.format = 'isot'
 assert (t.precision == 5)
 assert (t.out_subfmt == 'date_hms')
 assert (t.value == '2000-02-03T00:00:00.00000')
 t.format = 'fits'
 assert (t.value == tc.value)
 assert (t.precision == 5)

def test_set_format_shares_subfmt ( ) : t = Time ( '+02000-02-03' , format = 'fits' , out_subfmt = 'date_hms' , precision = 5 ) tc = t . copy ( ) t . format = 'isot' assert ( t . precision == 5 ) assert ( t . out_subfmt == 'date_hms' ) assert ( t . value == '2000-02-03T00:00:00.00000' ) t . format = 'fits' assert ( t . value == tc . value ) assert ( t . precision == 5 )
set format and round trip through a format that shares out_subfmt .