@@ -69,6 +69,12 @@ def test_auto_detect_cpus(testdir, monkeypatch):
6969 assert config .getoption ("numprocesses" ) == 0
7070 assert config .getoption ("dist" ) == "no"
7171
72+ config = testdir .parseconfigure ("-nlogical" , "--pdb" )
73+ check_options (config )
74+ assert config .getoption ("usepdb" )
75+ assert config .getoption ("numprocesses" ) == 0
76+ assert config .getoption ("dist" ) == "no"
77+
7278 monkeypatch .delattr (os , "sched_getaffinity" , raising = False )
7379 monkeypatch .setenv ("TRAVIS" , "true" )
7480 config = testdir .parseconfigure ("-nauto" )
@@ -81,12 +87,16 @@ def test_auto_detect_cpus_psutil(testdir, monkeypatch):
8187
8288 psutil = pytest .importorskip ("psutil" )
8389
84- monkeypatch .setattr (psutil , "cpu_count" , lambda logical = True : 42 )
90+ monkeypatch .setattr (psutil , "cpu_count" , lambda logical = True : 84 if logical else 42 )
8591
8692 config = testdir .parseconfigure ("-nauto" )
8793 check_options (config )
8894 assert config .getoption ("numprocesses" ) == 42
8995
96+ config = testdir .parseconfigure ("-nlogical" )
97+ check_options (config )
98+ assert config .getoption ("numprocesses" ) == 84
99+
90100
91101def test_hook_auto_num_workers (testdir , monkeypatch ):
92102 from xdist .plugin import pytest_cmdline_main as check_options
@@ -101,6 +111,10 @@ def pytest_xdist_auto_num_workers():
101111 check_options (config )
102112 assert config .getoption ("numprocesses" ) == 42
103113
114+ config = testdir .parseconfigure ("-nlogical" )
115+ check_options (config )
116+ assert config .getoption ("numprocesses" ) == 42
117+
104118
105119def test_boxed_with_collect_only (testdir ):
106120 from xdist .plugin import pytest_cmdline_main as check_options
0 commit comments