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
Add a testing case for a future check integrity flag #8633
base: main
Are you sure you want to change the base?
Changes from all commits
c751bca
ae8bcac
f4cf16d
8227dcd
d0d6d91
b3327e8
ce61044
9a00373
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ __pycache__/ | |
*.eggs | ||
*.egg-info/ | ||
MANIFEST | ||
pip-wheel-metadata/ | ||
|
||
# Documentation | ||
docs/build/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import pytest | ||
|
||
from tests.lib import create_test_package_with_setup | ||
|
||
|
||
|
@@ -292,3 +294,23 @@ def test_check_include_work_dir_pkg(script): | |
) | ||
assert matches_expected_lines(result.stdout, expected_lines) | ||
assert result.returncode == 1 | ||
|
||
|
||
@pytest.mark.xfail( | ||
reason='Not yet implemented: https://github.com/pypa/pip/pull/8633', | ||
strict=True, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please add I guess it's some kind of a subprocess error, right? |
||
) | ||
def test_check_integrity_errors_on_missing_files(data, script, tmpdir): | ||
fbidu marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By the way, this is a negative test. It's probably reasonable to add a positive test too (for when the integrity is fine) |
||
"""Ensure that pip check detects a missing file post-install.""" | ||
to_install = data.packages.joinpath("pip-test-package-0.1.tar.gz") | ||
result = script.pip_install_local(to_install) | ||
assert 'Successfully installed pip-test-package' in result.stdout | ||
|
||
(script.site_packages_path / "piptestpackage/__init__.py").unlink() | ||
|
||
result = script.pip('check --integrity', expect_error=True) | ||
expected_lines = ( | ||
"piptestpackage is missing the __init__.py file", | ||
) | ||
assert matches_expected_lines(result.stdout, expected_lines) | ||
assert result.returncode == 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can drop this now, FWIW.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.