@@ -111,6 +111,21 @@ def search_stdout(self, regex):
111
111
matching .append (line )
112
112
return matching
113
113
114
+ def check_stderr (self ):
115
+ def output_okay (out ):
116
+ for warning in ['[notice]' , 'WARNING:' , 'npm WARN' ,
117
+ 'npm notice' , 'DEPRECATION:' , 'Creating virtualenv' ,
118
+ 'config file not found:' , 'press [Y]' ]:
119
+ if out .startswith (warning ):
120
+ return True
121
+ return False
122
+ for e in self .stderr :
123
+ if len (e ) < 1 :
124
+ continue
125
+ # Don't err on verbosity from pip, npm
126
+ if not output_okay (e ):
127
+ raise Exception (f'reckless stderr contains `{ e } `' )
128
+
114
129
115
130
def reckless (cmds : list , dir : PosixPath = None ,
116
131
autoconfirm = True , timeout : int = 60 ):
@@ -217,7 +232,7 @@ def test_install(node_factory):
217
232
assert r .search_stdout ('dependencies installed successfully' )
218
233
assert r .search_stdout ('plugin installed:' )
219
234
assert r .search_stdout ('testplugpass enabled' )
220
- check_stderr ( r . stderr )
235
+ r . check_stderr ( )
221
236
plugin_path = Path (n .lightning_dir ) / 'reckless/testplugpass'
222
237
print (plugin_path )
223
238
assert os .path .exists (plugin_path )
@@ -232,7 +247,7 @@ def test_poetry_install(node_factory):
232
247
assert r .search_stdout ('dependencies installed successfully' )
233
248
assert r .search_stdout ('plugin installed:' )
234
249
assert r .search_stdout ('testplugpyproj enabled' )
235
- check_stderr ( r . stderr )
250
+ r . check_stderr ( )
236
251
plugin_path = Path (n .lightning_dir ) / 'reckless/testplugpyproj'
237
252
print (plugin_path )
238
253
assert os .path .exists (plugin_path )
@@ -278,7 +293,7 @@ def test_disable_enable(node_factory):
278
293
assert r .search_stdout ('dependencies installed successfully' )
279
294
assert r .search_stdout ('plugin installed:' )
280
295
assert r .search_stdout ('testplugpass enabled' )
281
- check_stderr ( r . stderr )
296
+ r . check_stderr ( )
282
297
plugin_path = Path (n .lightning_dir ) / 'reckless/testplugpass'
283
298
print (plugin_path )
284
299
assert os .path .exists (plugin_path )
0 commit comments