Skip to content

Commit bdc886b

Browse files
committed
Add xfail tests for case where specifications added as an extra are not honoured.
1 parent 2f3a1be commit bdc886b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/functional/test_install_extras.py

+29
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,32 @@ def test_install_special_extra(script):
126126
assert (
127127
"Could not find a version that satisfies the requirement missing_pkg"
128128
) 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

Comments
 (0)