def test_blackbody_exceptions_and_warnings():
 with pytest.raises(ValueError) as exc:
  blackbody_nu((1000 * u.AA), (-100))
 assert (exc.value.args[0] == u'Temperature should be positive: -100.0 K')
 with catch_warnings(AstropyUserWarning) as w:
  blackbody_nu((0 * u.AA), 5000)
 assert (len(w) == 1)
 assert (u'invalid' in w[0].message.args[0])
 with catch_warnings(AstropyUserWarning) as w:
  blackbody_nu(((-1.0) * u.AA), 5000)
 assert (len(w) == 1)
 assert (u'invalid' in w[0].message.args[0])

def test_blackbody_exceptions_and_warnings ( ) : with pytest . raises ( ValueError ) as exc : blackbody_nu ( ( 1000 * u . AA ) , ( - 100 ) ) assert ( exc . value . args [ 0 ] == u'Temperature should be positive: -100.0 K' ) with catch_warnings ( AstropyUserWarning ) as w : blackbody_nu ( ( 0 * u . AA ) , 5000 ) assert ( len ( w ) == 1 ) assert ( u'invalid' in w [ 0 ] . message . args [ 0 ] ) with catch_warnings ( AstropyUserWarning ) as w : blackbody_nu ( ( ( - 1.0 ) * u . AA ) , 5000 ) assert ( len ( w ) == 1 ) assert ( u'invalid' in w [ 0 ] . message . args [ 0 ] )
test exceptions .