Skip to content

Add xfail tests for case where specifications added as an extra are not honoured #8059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions tests/functional/test_install_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,32 @@ def test_install_special_extra(script):
assert (
"Could not find a version that satisfies the requirement missing_pkg"
) in result.stderr, str(result)


@pytest.mark.parametrize(
"extra_to_install, simple_version", [
['', '3.0'],
pytest.param('[extra1]', '2.0', marks=pytest.mark.xfail),
pytest.param('[extra2]', '1.0', marks=pytest.mark.xfail),
pytest.param('[extra1,extra2]', '1.0', marks=pytest.mark.xfail),
])
def test_install_extra_merging(script, data, extra_to_install, simple_version):
# Check that extra specifications in the extras section are honoured.
pkga_path = script.scratch_path / 'pkga'
pkga_path.mkdir()
pkga_path.joinpath("setup.py").write_text(textwrap.dedent("""
from setuptools import setup
setup(name='pkga',
version='0.1',
install_requires=['simple'],
extras_require={'extra1': ['simple<3'],
'extra2': ['simple==1.*']},
)
"""))

result = script.pip_install_local(
'{pkga_path}{extra_to_install}'.format(**locals()),
)

assert ('Successfully installed pkga-0.1 simple-{}'.format(simple_version)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

) in result.stdout