@@ -130,7 +130,6 @@ def _stream_app_logs(
130130 self ,
131131 app : AppConfig ,
132132 popen ,
133- test_mode = False ,
134133 clean_filter = None ,
135134 clean_output = False ,
136135 stop_func = lambda : False ,
@@ -143,7 +142,6 @@ def _stream_app_logs(
143142 :param app: The app to be launched
144143 :param popen: The Popen object for the stream we are monitoring; this Popen
145144 process will be closed after log streaming completes.
146- :param test_mode: Are we launching in test mode?
147145 :param clean_filter: The log cleaning filter to use; see ``LogFilter``
148146 for details.
149147 :param clean_output: Should the cleaned output be presented to the user?
@@ -179,7 +177,7 @@ def _stream_app_logs(
179177
180178 # If we're in test mode, and log streaming ends,
181179 # check for the status of the test suite.
182- if test_mode :
180+ if app . test_mode :
183181 if log_filter .returncode == 0 :
184182 self .console .info ("Test suite passed!" , prefix = app .app_name )
185183 else :
@@ -220,14 +218,13 @@ def add_options(self, parser):
220218 self ._add_update_options (parser , context_label = " before running" )
221219 self ._add_test_options (parser , context_label = "Run" )
222220
223- def _prepare_app_kwargs (self , app : AppConfig , test_mode : bool ):
221+ def _prepare_app_kwargs (self , app : AppConfig ):
224222 """Prepare the kwargs for running an app as a log stream.
225223
226224 This won't be used by every backend; but it's a sufficiently common default that
227225 it's been factored out.
228226
229227 :param app: The app to be launched
230- :param test_mode: Are we launching in test mode?
231228 :returns: A dictionary of additional arguments to pass to the Popen
232229 """
233230 args = {}
@@ -237,10 +234,10 @@ def _prepare_app_kwargs(self, app: AppConfig, test_mode: bool):
237234 if self .console .is_debug :
238235 env ["BRIEFCASE_DEBUG" ] = "1"
239236
240- if test_mode :
237+ if app . test_mode :
241238 # In test mode, set a BRIEFCASE_MAIN_MODULE environment variable
242239 # to override the module at startup
243- env ["BRIEFCASE_MAIN_MODULE" ] = app .main_module (test_mode )
240+ env ["BRIEFCASE_MAIN_MODULE" ] = app .main_module ()
244241 self .console .info ("Starting test_suite..." , prefix = app .app_name )
245242 else :
246243 self .console .info ("Starting app..." , prefix = app .app_name )
@@ -290,7 +287,7 @@ def __call__(
290287
291288 # Confirm host compatibility, that all required tools are available,
292289 # and that the app configuration is finalized.
293- self .finalize (app )
290+ self .finalize (app , test_mode )
294291
295292 template_file = self .bundle_path (app )
296293 exec_file = self .binary_executable_path (app )
@@ -303,7 +300,7 @@ def __call__(
303300 or update_stub # An explicit update of the stub binary has been requested
304301 or (not exec_file .exists ()) # Executable binary doesn't exist yet
305302 or (
306- test_mode and not no_update
303+ app . test_mode and not no_update
307304 ) # Test mode, but updates have not been disabled
308305 ):
309306 state = self .build_command (
@@ -314,7 +311,6 @@ def __call__(
314311 update_support = update_support ,
315312 update_stub = update_stub ,
316313 no_update = no_update ,
317- test_mode = test_mode ,
318314 ** options ,
319315 )
320316 else :
@@ -324,7 +320,6 @@ def __call__(
324320
325321 state = self .run_app (
326322 app ,
327- test_mode = test_mode ,
328323 passthrough = [] if passthrough is None else passthrough ,
329324 ** full_options (state , options ),
330325 )
0 commit comments