File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ Unreleased
23
23
- Debug: added ``pybehave `` to the list of :ref: `cmd_debug ` and
24
24
:ref: `cmd_run_debug ` options.
25
25
26
+ - Fix: show an intelligible error message if ``--concurrency=multiprocessing ``
27
+ is used without a configuration file. Closes `issue 1320 `_.
28
+
29
+ .. _issue 1320 : https://github.com/nedbat/coveragepy/issues/1320
30
+
26
31
27
32
.. _changes_631 :
28
33
Original file line number Diff line number Diff line change @@ -462,6 +462,8 @@ def _init_for_start(self):
462
462
raise ConfigError ( # pragma: only jython
463
463
"multiprocessing is not supported on this Python"
464
464
)
465
+ if self .config .config_file is None :
466
+ raise ConfigError ("multiprocessing requires a configuration file" )
465
467
patch_multiprocessing (rcfile = self .config .config_file )
466
468
467
469
dycon = self .config .dynamic_context
Original file line number Diff line number Diff line change @@ -369,6 +369,10 @@ def test_no_multiple_light_concurrency_in_config(self):
369
369
with pytest .raises (ConfigError , match = "Conflicting concurrency settings: eventlet, gevent" ):
370
370
self .command_line ("run prog.py" )
371
371
372
+ def test_multiprocessing_needs_config_file (self ):
373
+ with pytest .raises (ConfigError , match = "multiprocessing requires a configuration file" ):
374
+ self .command_line ("run --concurrency=multiprocessing prog.py" )
375
+
372
376
373
377
class WithoutConcurrencyModuleTest (CoverageTest ):
374
378
"""Tests of what happens if the requested concurrency isn't installed."""
You can’t perform that action at this time.
0 commit comments