#NEWLINE# def test_player_play_fail_raises_error( self , session_lib_mock , lib_mock ) : #NEWLINE# #INDENT# lib_mock . sp_session_player_play . return_value = spotify . ErrorType . BAD_API_VERSION #NEWLINE# session = tests . create_real_session ( session_lib_mock ) #NEWLINE# player_state = session_lib_mock . player . state #NEWLINE# with self . assertRaises ( spotify . Error ) : #NEWLINE# #INDENT# session . player . play ( True ) #NEWLINE# #UNINDENT# self . assertEqual ( session . player . state , player_state )