@@ -1281,15 +1281,49 @@ def pytest_configure(config):
1281
1281
sb_config ._html_report_name = None # The name of the pytest html report
1282
1282
1283
1283
arg_join = " " .join (sys .argv )
1284
- if ("-n" in sys .argv ) or (" -n=" in arg_join ) or ("-c" in sys .argv ):
1284
+ if (
1285
+ "-n" in sys .argv
1286
+ or " -n=" in arg_join
1287
+ or "-c" in sys .argv
1288
+ or (
1289
+ "addopts" in config .inicfg .keys ()
1290
+ and (
1291
+ "-n=" in config .inicfg ["addopts" ]
1292
+ or "-n " in config .inicfg ["addopts" ]
1293
+ )
1294
+ )
1295
+ ):
1285
1296
sb_config ._multithreaded = True
1286
- if "--html" in sys .argv or " --html=" in arg_join :
1297
+ if (
1298
+ "--html" in sys .argv
1299
+ or " --html=" in arg_join
1300
+ or (
1301
+ "addopts" in config .inicfg .keys ()
1302
+ and (
1303
+ "--html=" in config .inicfg ["addopts" ]
1304
+ or "--html " in config .inicfg ["addopts" ]
1305
+ )
1306
+ )
1307
+ ):
1287
1308
sb_config ._using_html_report = True
1288
1309
sb_config ._html_report_name = config .getoption ("htmlpath" )
1289
1310
if sb_config .dashboard :
1290
1311
if sb_config ._html_report_name == "dashboard.html" :
1291
1312
sb_config ._dash_is_html_report = True
1292
1313
1314
+ # Recorder Mode does not support multi-threaded / multi-process runs.
1315
+ if sb_config .recorder_mode and sb_config ._multithreaded :
1316
+ # At this point, the user likely put a "-n NUM" in the pytest.ini file.
1317
+ # Since raising an exception in pytest_configure raises INTERNALERROR,
1318
+ # print a message here instead and cancel Recorder Mode.
1319
+ print (
1320
+ "\n Recorder Mode does NOT support multi-process mode (-n)!"
1321
+ '\n (DO NOT combine "--recorder" with "-n NUM_PROCESSES"!)'
1322
+ '\n (The Recorder WILL BE DISABLED during this run!)\n '
1323
+ )
1324
+ sb_config .recorder_mode = False
1325
+ sb_config .recorder_ext = False
1326
+
1293
1327
if sb_config .xvfb and "linux" not in sys .platform :
1294
1328
# The Xvfb virtual display server is for Linux OS Only!
1295
1329
sb_config .xvfb = False
0 commit comments