File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -379,6 +379,10 @@ def run(
379379 if not args :
380380 raise ValueError ("At least one argument required to run()." )
381381
382+ if len (args ) == 1 and isinstance (args [0 ], (list , tuple )):
383+ msg = "First argument to `session.run` is a list. Did you mean to use `session.run(*args)`?"
384+ raise ValueError (msg )
385+
382386 if self ._runner .global_config .install_only :
383387 logger .info (f"Skipping { args [0 ]} run, as --install-only is set." )
384388 return None
Original file line number Diff line number Diff line change @@ -842,6 +842,12 @@ def test___dict__(self):
842842 expected = {name : getattr (session , name ) for name in session .__slots__ }
843843 assert session .__dict__ == expected
844844
845+ def test_first_arg_list (self ):
846+ session , _ = self .make_session_and_runner ()
847+
848+ with pytest .raises (ValueError ):
849+ session .run (["ls" , "-al" ])
850+
845851
846852class TestSessionRunner :
847853 def make_runner (self ):
You can’t perform that action at this time.
0 commit comments