@@ -57,12 +57,28 @@ def test_spawned_process_error(self):
5757 exc_args = ('foo bar' , 'partial output' , 'error message' , 1 )
5858 e = exc .SpawnedProcessError (* exc_args )
5959 with pytest .raises (
60- exc .ReframeError ,
61- match = r"command 'foo bar' failed with exit code 1:\n"
62- r"=== STDOUT ===\n"
63- r'partial output\n'
64- r"=== STDERR ===\n"
65- r"error message" ):
60+ exc .ReframeError ,
61+ match = (r"command 'foo bar' failed with exit code 1:\n"
62+ r"=== STDOUT ===\n"
63+ r'partial output\n'
64+ r"=== STDERR ===\n"
65+ r"error message" )
66+ ):
67+ raise_exc (e )
68+
69+ assert exc_args == e .args
70+
71+ def test_spawned_process_error_list_args (self ):
72+ exc_args = (['foo' , 'bar' ], 'partial output' , 'error message' , 1 )
73+ e = exc .SpawnedProcessError (* exc_args )
74+ with pytest .raises (
75+ exc .ReframeError ,
76+ match = (r"command 'foo bar' failed with exit code 1:\n"
77+ r"=== STDOUT ===\n"
78+ r'partial output\n'
79+ r"=== STDERR ===\n"
80+ r"error message" )
81+ ):
6682 raise_exc (e )
6783
6884 assert exc_args == e .args
@@ -71,33 +87,35 @@ def test_spawned_process_error_nostdout(self):
7187 exc_args = ('foo bar' , '' , 'error message' , 1 )
7288 e = exc .SpawnedProcessError (* exc_args )
7389 with pytest .raises (
74- exc .ReframeError ,
75- match = r"command 'foo bar' failed with exit code 1:\n"
76- r"=== STDOUT ===\n"
77- r"=== STDERR ===\n"
78- r"error message" ):
90+ exc .ReframeError ,
91+ match = (r"command 'foo bar' failed with exit code 1:\n"
92+ r"=== STDOUT ===\n"
93+ r"=== STDERR ===\n"
94+ r"error message" )
95+ ):
7996 raise_exc (e )
8097
8198 def test_spawned_process_error_nostderr (self ):
8299 exc_args = ('foo bar' , 'partial output' , '' , 1 )
83100 e = exc .SpawnedProcessError (* exc_args )
84101 with pytest .raises (
85- exc .ReframeError ,
86- match = r"command 'foo bar' failed with exit code 1:\n"
87- r"=== STDOUT ===\n"
88- r'partial output\n'
89- r"=== STDERR ===" ):
102+ exc .ReframeError ,
103+ match = (r"command 'foo bar' failed with exit code 1:\n"
104+ r"=== STDOUT ===\n"
105+ r'partial output\n'
106+ r"=== STDERR ===" )
107+ ):
90108 raise_exc (e )
91109
92110 def test_spawned_process_timeout (self ):
93111 exc_args = ('foo bar' , 'partial output' , 'partial error' , 10 )
94112 e = exc .SpawnedProcessTimeout (* exc_args )
95113 with pytest .raises (exc .ReframeError ,
96- match = r"command 'foo bar' timed out after 10s:\n"
97- r"=== STDOUT ===\n"
98- r'partial output\n'
99- r"=== STDERR ===\n"
100- r"partial error" ):
114+ match = ( r"command 'foo bar' timed out after 10s:\n"
115+ r"=== STDOUT ===\n"
116+ r'partial output\n'
117+ r"=== STDERR ===\n"
118+ r"partial error" ) ):
101119 raise_exc (e )
102120
103121 assert exc_args == e .args
@@ -106,20 +124,20 @@ def test_spawned_process_timeout_nostdout(self):
106124 exc_args = ('foo bar' , '' , 'partial error' , 10 )
107125 e = exc .SpawnedProcessTimeout (* exc_args )
108126 with pytest .raises (exc .ReframeError ,
109- match = r"command 'foo bar' timed out after 10s:\n"
110- r"=== STDOUT ===\n"
111- r"=== STDERR ===\n"
112- r"partial error" ):
127+ match = ( r"command 'foo bar' timed out after 10s:\n"
128+ r"=== STDOUT ===\n"
129+ r"=== STDERR ===\n"
130+ r"partial error" ) ):
113131 raise_exc (e )
114132
115133 def test_spawned_process_timeout_nostderr (self ):
116134 exc_args = ('foo bar' , 'partial output' , '' , 10 )
117135 e = exc .SpawnedProcessTimeout (* exc_args )
118136 with pytest .raises (exc .ReframeError ,
119- match = r"command 'foo bar' timed out after 10s:\n"
120- r"=== STDOUT ===\n"
121- r'partial output\n'
122- r"=== STDERR ===" ):
137+ match = ( r"command 'foo bar' timed out after 10s:\n"
138+ r"=== STDOUT ===\n"
139+ r'partial output\n'
140+ r"=== STDERR ===" ) ):
123141 raise_exc (e )
124142
125143 def test_job_error (self ):
0 commit comments