#NEWLINE# @ pytest . mark . parametrize ( 'grid_type' , [ 'car' , 'sph' , 'cyl' , 'amr' , 'oct' ] ) #NEWLINE# def test_mismatch_density_energy_2( self , tmpdir , grid_type ) : #NEWLINE# #INDENT# m = Model ( ) #NEWLINE# m . set_grid ( self . grid [ grid_type ] ) #NEWLINE# m . add_density_grid ( self . density [ grid_type ] , tmpdir . dust , specific_energy = self . density [ grid_type ] ) #NEWLINE# m . add_density_grid ( self . density [ grid_type ] , self . dust ) #NEWLINE# m . set_n_photons ( initial = 100 , imaging = 100 ) #NEWLINE# with pytest . raises ( Exception ) as exc : #NEWLINE# #INDENT# m . write ( tmpdir . join ( random_id ( ) ) . strpath ) #NEWLINE# #UNINDENT# assert ( exc . value . args [ 0 ] == 'Not all dust lists in the grid have the same size' )