File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,35 @@ describe('PythonShell', function () {
192192 }
193193
194194 } ) ;
195+
196+ it ( 'should be able to run modules' , function ( done ) {
197+ PythonShell . defaultOptions = { } ;
198+
199+ PythonShell . run ( '-m' , {
200+ args : [ 'timeit' , '-n 1' , `'x=5'` ]
201+ } , function ( err , results ) {
202+
203+ PythonShell . defaultOptions = {
204+ // reset to match initial value
205+ scriptPath : pythonFolder
206+ } ;
207+
208+ if ( err ) return done ( err ) ;
209+ results . should . be . an . Array ( ) ;
210+ results [ 0 ] . should . be . an . String ( ) ;
211+ results [ 0 ] . slice ( 0 , 6 ) . should . eql ( '1 loop' ) ;
212+ done ( ) ;
213+ } ) ;
214+ } )
215+
216+ after ( ( ) => {
217+ // should be able to run modules test should theoretically reset this
218+ // but we have this to in case something goes horribly wrong with the test
219+ PythonShell . defaultOptions = {
220+ // reset to match initial value
221+ scriptPath : pythonFolder
222+ } ;
223+ } )
195224 } ) ;
196225
197226 describe ( '.send(message)' , function ( ) {
You can’t perform that action at this time.
0 commit comments