5
5
6
6
from poetry .config .config_source import ConfigSource
7
7
from poetry .factory import Factory
8
+ from poetry .utils ._compat import PY2
9
+ from poetry .utils ._compat import WINDOWS
8
10
9
11
10
12
@pytest .fixture ()
@@ -17,6 +19,7 @@ def test_list_displays_default_value_if_not_set(tester, config):
17
19
18
20
expected = """cache-dir = "/foo"
19
21
experimental.new-installer = true
22
+ installer.parallel = true
20
23
virtualenvs.create = true
21
24
virtualenvs.in-project = null
22
25
virtualenvs.path = {path} # /foo{sep}virtualenvs
@@ -34,6 +37,7 @@ def test_list_displays_set_get_setting(tester, config):
34
37
35
38
expected = """cache-dir = "/foo"
36
39
experimental.new-installer = true
40
+ installer.parallel = true
37
41
virtualenvs.create = false
38
42
virtualenvs.in-project = null
39
43
virtualenvs.path = {path} # /foo{sep}virtualenvs
@@ -73,6 +77,7 @@ def test_list_displays_set_get_local_setting(tester, config):
73
77
74
78
expected = """cache-dir = "/foo"
75
79
experimental.new-installer = true
80
+ installer.parallel = true
76
81
virtualenvs.create = false
77
82
virtualenvs.in-project = null
78
83
virtualenvs.path = {path} # /foo{sep}virtualenvs
@@ -108,3 +113,25 @@ def test_set_cert(tester, auth_config_source, mocker):
108
113
tester .execute ("certificates.foo.cert path/to/ca.pem" )
109
114
110
115
assert "path/to/ca.pem" == auth_config_source .config ["certificates" ]["foo" ]["cert" ]
116
+
117
+
118
+ @pytest .mark .skipif (
119
+ PY2 and WINDOWS , reason = "Python 2.7 under windows is enforced serial"
120
+ )
121
+ def test_config_installer_parallel (tester , command_tester_factory ):
122
+ tester .execute ("--local installer.parallel" )
123
+ assert tester .io .fetch_output ().strip () == "true"
124
+
125
+ assert (
126
+ command_tester_factory ("install" )._command ._installer ._executor ._max_workers > 1
127
+ )
128
+
129
+ tester .io .clear_output ()
130
+ tester .execute ("--local installer.parallel false" )
131
+ tester .execute ("--local installer.parallel" )
132
+ assert tester .io .fetch_output ().strip () == "false"
133
+
134
+ assert (
135
+ command_tester_factory ("install" )._command ._installer ._executor ._max_workers
136
+ == 1
137
+ )
0 commit comments