@@ -126,3 +126,32 @@ def test_install_special_extra(script):
126
126
assert (
127
127
"Could not find a version that satisfies the requirement missing_pkg"
128
128
) in result .stderr , str (result )
129
+
130
+
131
+ @pytest .mark .parametrize (
132
+ "extra_to_install, simple_version" , [
133
+ ['' , '3.0' ],
134
+ pytest .param ('[extra1]' , '2.0' , marks = pytest .mark .xfail ),
135
+ pytest .param ('[extra2]' , '1.0' , marks = pytest .mark .xfail ),
136
+ pytest .param ('[extra1,extra2]' , '1.0' , marks = pytest .mark .xfail ),
137
+ ])
138
+ def test_install_extra_merging (script , data , extra_to_install , simple_version ):
139
+ # Check that extra specifications in the extras section are honoured.
140
+ pkga_path = script .scratch_path / 'pkga'
141
+ pkga_path .mkdir ()
142
+ pkga_path .joinpath ("setup.py" ).write_text (textwrap .dedent ("""
143
+ from setuptools import setup
144
+ setup(name='pkga',
145
+ version='0.1',
146
+ install_requires=['simple'],
147
+ extras_require={'extra1': ['simple<3'],
148
+ 'extra2': ['simple==1.*']},
149
+ )
150
+ """ ))
151
+
152
+ result = script .pip_install_local (
153
+ '{pkga_path}{extra_to_install}' .format (** locals ()),
154
+ )
155
+
156
+ assert ('Successfully installed pkga-0.1 simple-{}' .format (simple_version )
157
+ ) in result .stdout
0 commit comments