Mark tests requiring Internet access

This commit is contained in:
Matej Stuchlik 2015-01-15 00:53:15 +01:00
parent ee6b739fb6
commit c5024dc851
22 changed files with 133 additions and 0 deletions

View File

@ -1,6 +1,7 @@
import sys
import re
import textwrap
import pytest
from doctest import OutputChecker, ELLIPSIS
from tests.lib.local_repos import local_checkout, local_repo
@ -64,6 +65,7 @@ def test_freeze_basic(script):
_check_output(result, expected)
@pytest.mark.network
def test_freeze_svn(script, tmpdir):
"""Test freezing a svn checkout"""
@ -99,6 +101,7 @@ def test_freeze_svn(script, tmpdir):
_check_output(result, expected)
@pytest.mark.network
def test_freeze_git_clone(script, tmpdir):
"""
Test freezing a Git clone.
@ -192,6 +195,7 @@ def test_freeze_git_clone(script, tmpdir):
_check_output(result, expected)
@pytest.mark.network
def test_freeze_mercurial_clone(script, tmpdir):
"""
Test freezing a Mercurial clone.
@ -253,6 +257,7 @@ def test_freeze_mercurial_clone(script, tmpdir):
_check_output(result, expected)
@pytest.mark.network
def test_freeze_bazaar_clone(script, tmpdir):
"""
Test freezing a Bazaar clone.
@ -302,6 +307,7 @@ def test_freeze_bazaar_clone(script, tmpdir):
_check_output(result, expected)
@pytest.mark.network
def test_freeze_with_local_option(script):
"""
Test that wsgiref (from global site-packages) is reported normally, but not
@ -332,6 +338,7 @@ def test_freeze_with_local_option(script):
_check_output(result, expected)
@pytest.mark.network
def test_freeze_with_requirement_option(script):
"""
Test that new requirements are created correctly with --requirement hints

View File

@ -13,6 +13,7 @@ from tests.lib.local_repos import local_checkout
from tests.lib.path import Path
@pytest.mark.network
def test_without_setuptools(script):
script.run("pip", "uninstall", "setuptools", "-y")
result = script.run(
@ -26,6 +27,7 @@ def test_without_setuptools(script):
)
@pytest.mark.network
def test_pip_second_command_line_interface_works(script):
"""
Check if ``pip<PYVERSION>`` commands behaves equally
@ -41,6 +43,7 @@ def test_pip_second_command_line_interface_works(script):
assert initools_folder in result.files_created, str(result)
@pytest.mark.network
def test_install_from_pypi(script):
"""
Test installing a package from PyPI.
@ -67,6 +70,7 @@ def test_editable_install(script):
assert not result.files_updated
@pytest.mark.network
def test_install_editable_from_svn(script, tmpdir):
"""
Test checking out from svn.
@ -83,6 +87,7 @@ def test_install_editable_from_svn(script, tmpdir):
result.assert_installed('INITools', with_files=['.svn'])
@pytest.mark.network
def test_download_editable_to_custom_path(script, tmpdir):
"""
Test downloading an editable using a relative custom src folder.
@ -117,6 +122,7 @@ def test_download_editable_to_custom_path(script, tmpdir):
assert customdl_files_created
@pytest.mark.network
def test_editable_no_install_followed_by_no_download(script, tmpdir):
"""
Test installing an editable in two steps (first with --no-install, then
@ -151,6 +157,7 @@ def test_editable_no_install_followed_by_no_download(script, tmpdir):
result.assert_installed('INITools', without_files=[curdir, '.svn'])
@pytest.mark.network
def test_no_install_followed_by_no_download(script):
"""
Test installing in two steps (first with --no-install, then with
@ -197,6 +204,7 @@ def test_bad_install_with_no_download(script):
)
@pytest.mark.network
def test_install_dev_version_from_pypi(script):
"""
Test using package==dev.
@ -212,6 +220,7 @@ def test_install_dev_version_from_pypi(script):
)
@pytest.mark.network
def test_install_editable_from_git(script, tmpdir):
"""
Test cloning from Git.
@ -229,6 +238,7 @@ def test_install_editable_from_git(script, tmpdir):
result.assert_installed('pip-test-package', with_files=['.git'])
@pytest.mark.network
def test_install_editable_from_hg(script, tmpdir):
"""
Test cloning from Mercurial.
@ -245,6 +255,7 @@ def test_install_editable_from_hg(script, tmpdir):
result.assert_installed('ScriptTest', with_files=['.hg'])
@pytest.mark.network
def test_vcs_url_final_slash_normalization(script, tmpdir):
"""
Test that presence or absence of final slash in VCS URL is normalized.
@ -259,6 +270,7 @@ def test_vcs_url_final_slash_normalization(script, tmpdir):
)
@pytest.mark.network
def test_install_editable_from_bazaar(script, tmpdir):
"""
Test checking out from Bazaar.
@ -276,6 +288,7 @@ def test_install_editable_from_bazaar(script, tmpdir):
result.assert_installed('django-wikiapp', with_files=['.bzr'])
@pytest.mark.network
def test_vcs_url_urlquote_normalization(script, tmpdir):
"""
Test that urlquoted characters are normalized for repo URL comparison.
@ -383,6 +396,7 @@ def test_install_pardir(script, data):
assert egg_info_folder in result.files_created, str(result)
@pytest.mark.network
def test_install_global_option(script):
"""
Test using global distutils options.
@ -410,6 +424,7 @@ def test_install_with_hacked_egg_info(script, data):
assert 'Successfully installed hackedegginfo-0.0.0\n' in result.stdout
@pytest.mark.network
def test_install_using_install_option_and_editable(script, tmpdir):
"""
Test installing a tool using -e and --install-option
@ -429,6 +444,7 @@ def test_install_using_install_option_and_editable(script, tmpdir):
assert script_file in result.files_created
@pytest.mark.network
def test_install_global_option_using_editable(script, tmpdir):
"""
Test using global distutils options, but in an editable installation
@ -441,6 +457,7 @@ def test_install_global_option_using_editable(script, tmpdir):
assert '0.2.5\n' in result.stdout
@pytest.mark.network
def test_install_package_with_same_name_in_curdir(script):
"""
Test installing a package with the same name of a local folder
@ -494,6 +511,7 @@ def test_install_folder_using_relative_path(script):
assert egg_folder in result.files_created, str(result)
@pytest.mark.network
def test_install_package_which_contains_dev_in_name(script):
"""
Test installing package from pypi which contains 'dev' in name
@ -508,6 +526,7 @@ def test_install_package_which_contains_dev_in_name(script):
assert egg_info_folder in result.files_created, str(result)
@pytest.mark.network
def test_install_package_with_target(script):
"""
Test installing a package using pip install --target
@ -680,6 +699,7 @@ def test_url_incorrect_case_file_index(script, data):
assert egg_folder in result.files_created, str(result)
@pytest.mark.network
def test_compiles_pyc(script):
"""
Test installing with --compile on
@ -700,6 +720,7 @@ def test_compiles_pyc(script):
assert any(exists)
@pytest.mark.network
def test_no_compiles_pyc(script, data):
"""
Test installing from wheel with --compile on

View File

@ -1,4 +1,5 @@
import os
import pytest
from os.path import exists
@ -22,6 +23,7 @@ def test_cleanup_after_install(script, data):
script.assert_no_temp()
@pytest.mark.network
def test_no_clean_option_blocks_cleaning_after_install(script, data):
"""
Test --no-clean option blocks cleaning after install
@ -34,6 +36,7 @@ def test_no_clean_option_blocks_cleaning_after_install(script, data):
assert exists(build)
@pytest.mark.network
def test_cleanup_after_install_editable_from_hg(script, tmpdir):
"""
Test clean up after cloning from Mercurial.
@ -69,6 +72,7 @@ def test_cleanup_after_install_from_local_directory(script, data):
script.assert_no_temp()
@pytest.mark.network
def test_no_install_and_download_should_not_leave_build_dir(script):
"""
It should remove build/ dir if it was pip that created
@ -107,6 +111,7 @@ def test_cleanup_req_satisifed_no_name(script, data):
script.assert_no_temp()
@pytest.mark.network
def test_download_should_not_delete_existing_build_dir(script):
"""
It should not delete build/ if existing before run the command
@ -153,6 +158,7 @@ def test_cleanup_after_egg_info_exception(script, data):
script.assert_no_temp()
@pytest.mark.network
def test_cleanup_prevented_upon_build_dir_exception(script, data):
"""
Test no cleanup occurs after a PreviousBuildDirError

View File

@ -3,9 +3,11 @@ Tests for compatibility workarounds.
"""
import os
import pytest
from tests.lib import pyversion, assert_all_changes
@pytest.mark.network
def test_debian_egg_name_workaround(script):
"""
We can uninstall packages installed with the pyversion removed from the

View File

@ -1,6 +1,7 @@
import os
import tempfile
import textwrap
import pytest
def test_options_from_env_vars(script):
@ -38,6 +39,7 @@ def test_command_line_options_override_env_vars(script, virtualenv):
assert "Getting page http://download.zope.org/ppix" in result.stdout
@pytest.mark.network
def test_env_vars_override_config_file(script, virtualenv):
"""
Test that environmental variables override settings in config files.
@ -75,6 +77,7 @@ def _test_env_vars_override_config_file(script, virtualenv, config_file):
assert "Successfully installed INITools" in result.stdout
@pytest.mark.network
def test_command_line_append_flags(script, virtualenv, data):
"""
Test command line flags that append to defaults set by environmental
@ -99,6 +102,7 @@ def test_command_line_append_flags(script, virtualenv, data):
assert "Skipping link %s" % data.find_links in result.stdout
@pytest.mark.network
def test_command_line_appends_correctly(script, data):
"""
Test multiple appending options set by environmental variables.

View File

@ -1,9 +1,11 @@
import os
import textwrap
import pytest
from tests.lib.path import Path
@pytest.mark.network
def test_download_if_requested(script):
"""
It should download (in the scratch path) and not install if requested.
@ -15,6 +17,7 @@ def test_download_if_requested(script):
assert script.site_packages / 'initools' not in result.files_created
@pytest.mark.network
def test_download_wheel(script):
"""
Test using "pip install --download" to download a *.whl archive.
@ -33,6 +36,7 @@ def test_download_wheel(script):
assert script.site_packages / 'piptestpackage' not in result.files_created
@pytest.mark.network
def test_single_download_from_requirements_file(script):
"""
It should support download (in the scratch path) from PyPi from a
@ -49,6 +53,7 @@ def test_single_download_from_requirements_file(script):
assert script.site_packages / 'initools' not in result.files_created
@pytest.mark.network
def test_download_should_download_dependencies(script):
"""
It should download dependencies (in the scratch path)
@ -92,6 +97,7 @@ def test_download_should_download_wheel_deps(script, data):
assert Path('scratch') / dep_filename in result.files_created
@pytest.mark.network
def test_download_should_skip_existing_files(script):
"""
It should not download files already existing in the scratch dir
@ -127,6 +133,7 @@ def test_download_should_skip_existing_files(script):
assert script.site_packages / 'openid' not in result.files_created
@pytest.mark.network
def test_download_vcs_link(script):
"""
It should allow -d flag for vcs links, regression test for issue #798.

View File

@ -1,6 +1,8 @@
import pytest
from os.path import join
@pytest.mark.network
def test_simple_extras_install_from_pypi(script):
"""
Test installing a package from PyPI using extras dependency Paste[openid].
@ -31,6 +33,7 @@ def test_extras_after_wheel(script, data):
assert simple in extra.files_created, extra.files_created
@pytest.mark.network
def test_no_extras_uninstall(script):
"""
No extras dependency gets uninstalled when the root package is uninstalled

View File

@ -8,6 +8,7 @@ from tests.lib import (pyversion, path_to_url,
from tests.lib.local_repos import local_checkout
@pytest.mark.network
def test_requirements_file(script):
"""
Test installing from a requirements file.
@ -73,6 +74,7 @@ def test_relative_requirements_file(script, data):
)
@pytest.mark.network
def test_multiple_requirements_files(script, tmpdir):
"""
Test installing from multiple nested requirements files.
@ -145,6 +147,7 @@ def test_install_local_editable_with_extras(script, data):
assert script.site_packages / 'simple' in res.files_created, str(res)
@pytest.mark.network
def test_install_collected_dependancies_first(script):
result = script.pip(
'install', 'paramiko',
@ -154,6 +157,7 @@ def test_install_collected_dependancies_first(script):
assert text.endswith('paramiko')
@pytest.mark.network
def test_install_local_editable_with_subdirectory(script):
version_pkg_path = _create_test_package_with_subdirectory(script,
'version_subdir')

View File

@ -23,6 +23,7 @@ def test_no_upgrade_unless_requested(script):
)
@pytest.mark.network
def test_upgrade_to_specific_version(script):
"""
It does upgrade to specific version requested.
@ -43,6 +44,7 @@ def test_upgrade_to_specific_version(script):
)
@pytest.mark.network
def test_upgrade_if_requested(script):
"""
And it does upgrade if requested.
@ -70,6 +72,7 @@ def test_upgrade_with_newest_already_installed(script, data):
assert 'already up-to-date' in result.stdout, result.stdout
@pytest.mark.network
def test_upgrade_force_reinstall_newest(script):
"""
Force reinstallation of a package even if it is already at its newest
@ -87,6 +90,7 @@ def test_upgrade_force_reinstall_newest(script):
assert_all_changes(result, result3, [script.venv / 'build', 'cache'])
@pytest.mark.network
def test_uninstall_before_upgrade(script):
"""
Automatic uninstall-before-upgrade.
@ -102,6 +106,7 @@ def test_uninstall_before_upgrade(script):
assert_all_changes(result, result3, [script.venv / 'build', 'cache'])
@pytest.mark.network
def test_uninstall_before_upgrade_from_url(script):
"""
Automatic uninstall-before-upgrade from URL.
@ -122,6 +127,7 @@ def test_uninstall_before_upgrade_from_url(script):
assert_all_changes(result, result3, [script.venv / 'build', 'cache'])
@pytest.mark.network
def test_upgrade_to_same_version_from_url(script):
"""
When installing from a URL the same version that is already installed, no
@ -143,6 +149,7 @@ def test_upgrade_to_same_version_from_url(script):
assert_all_changes(result, result3, [script.venv / 'build', 'cache'])
@pytest.mark.network
def test_upgrade_from_reqs_file(script):
"""
Upgrade from a requirements file.
@ -226,6 +233,7 @@ def test_editable_git_upgrade(script):
)
@pytest.mark.network
def test_should_not_install_always_from_cache(script):
"""
If there is an old cached package, pip should download the newer version
@ -244,6 +252,7 @@ def test_should_not_install_always_from_cache(script):
)
@pytest.mark.network
def test_install_with_ignoreinstalled_requested(script):
"""
Test old conflicting package is completely ignored
@ -260,6 +269,7 @@ def test_install_with_ignoreinstalled_requested(script):
)
@pytest.mark.network
def test_upgrade_vcs_req_with_no_dists_found(script, tmpdir):
"""It can upgrade a VCS requirement that has no distributions otherwise."""
req = "%s#egg=pip-test-package" % local_checkout(
@ -271,6 +281,7 @@ def test_upgrade_vcs_req_with_no_dists_found(script, tmpdir):
assert not result.returncode
@pytest.mark.network
def test_upgrade_vcs_req_with_dist_found(script):
"""It can upgrade a VCS requirement that has distributions on the index."""
# TODO(pnasrat) Using local_checkout fails on windows - oddness with the

View File

@ -4,6 +4,7 @@ tests specific to "pip install --user"
import imp
import os
import textwrap
import pytest
from os.path import curdir, isdir, isfile
@ -35,6 +36,7 @@ def _patch_dist_in_site_packages(script):
class Tests_UserSite:
@pytest.mark.network
def test_reset_env_system_site_packages_usersite(self, script, virtualenv):
"""
reset_env(system_site_packages=True) produces env where a --user
@ -53,6 +55,7 @@ class Tests_UserSite:
project_name
)
@pytest.mark.network
def test_install_subversion_usersite_editable_with_distribute(
self, script, virtualenv, tmpdir):
"""
@ -104,6 +107,7 @@ class Tests_UserSite:
"visible in this virtualenv." in result.stdout
)
@pytest.mark.network
def test_install_user_conflict_in_usersite(self, script, virtualenv):
"""
Test user install with conflict in usersite updates usersite.
@ -126,6 +130,7 @@ class Tests_UserSite:
assert egg_info_folder in result2.files_created, str(result2)
assert not isfile(initools_v3_file), initools_v3_file
@pytest.mark.network
def test_install_user_conflict_in_globalsite(self, script, virtualenv):
"""
Test user install with conflict in global site ignores site and
@ -168,6 +173,7 @@ class Tests_UserSite:
assert isdir(egg_info_folder)
assert isdir(initools_folder)
@pytest.mark.network
def test_upgrade_user_conflict_in_globalsite(self, script, virtualenv):
"""
Test user install/upgrade with conflict in global site ignores site and
@ -209,6 +215,7 @@ class Tests_UserSite:
assert isdir(egg_info_folder), result2.stdout
assert isdir(initools_folder)
@pytest.mark.network
def test_install_user_conflict_in_globalsite_and_usersite(
self, script, virtualenv):
"""
@ -257,6 +264,7 @@ class Tests_UserSite:
assert isdir(egg_info_folder)
assert isdir(initools_folder)
@pytest.mark.network
def test_install_user_in_global_virtualenv_with_conflict_fails(
self, script, virtualenv):
"""

View File

@ -1,8 +1,11 @@
import pytest
from tests.lib import (_create_test_package, _change_test_package_version,
pyversion)
from tests.lib.local_repos import local_checkout
@pytest.mark.network
def test_install_editable_from_git_with_https(script, tmpdir):
"""
Test cloning from Git with https.
@ -19,6 +22,7 @@ def test_install_editable_from_git_with_https(script, tmpdir):
result.assert_installed('pip-test-package', with_files=['.git'])
@pytest.mark.network
def test_install_noneditable_git(script, tmpdir):
"""
Test installing from a non-editable git URL with a given tag.
@ -38,6 +42,7 @@ def test_install_noneditable_git(script, tmpdir):
assert egg_info_folder in result.files_created, str(result)
@pytest.mark.network
def test_git_with_sha1_revisions(script):
"""
Git backend should be able to install from SHA1 revisions
@ -57,6 +62,7 @@ def test_git_with_sha1_revisions(script):
assert '0.1' in version.stdout, version.stdout
@pytest.mark.network
def test_git_with_branch_name_as_revision(script):
"""
Git backend should be able to install from branch names
@ -76,6 +82,7 @@ def test_git_with_branch_name_as_revision(script):
assert 'some different version' in version.stdout
@pytest.mark.network
def test_git_with_tag_name_as_revision(script):
"""
Git backend should be able to install from tag names
@ -95,6 +102,7 @@ def test_git_with_tag_name_as_revision(script):
assert '0.1' in version.stdout
@pytest.mark.network
def test_git_with_tag_name_and_update(script, tmpdir):
"""
Test cloning a git repository and updating to a different version.
@ -120,6 +128,7 @@ def test_git_with_tag_name_and_update(script, tmpdir):
assert '0.1.2' in result.stdout
@pytest.mark.network
def test_git_branch_should_not_be_changed(script, tmpdir):
"""
Editable installations should not change branch
@ -138,6 +147,7 @@ def test_git_branch_should_not_be_changed(script, tmpdir):
assert '* master' in result.stdout, result.stdout
@pytest.mark.network
def test_git_with_non_editable_unpacking(script, tmpdir):
"""
Test cloning a git repository from a non-editable URL with a given tag.
@ -154,6 +164,7 @@ def test_git_with_non_editable_unpacking(script, tmpdir):
assert '0.1.2' in result.stdout
@pytest.mark.network
def test_git_with_editable_where_egg_contains_dev_string(script, tmpdir):
"""
Test cloning a git repository from an editable url which contains "dev"
@ -170,6 +181,7 @@ def test_git_with_editable_where_egg_contains_dev_string(script, tmpdir):
result.assert_installed('django-devserver', with_files=['.git'])
@pytest.mark.network
def test_git_with_non_editable_where_egg_contains_dev_string(script, tmpdir):
"""
Test cloning a git repository from a non-editable url which contains "dev"
@ -187,6 +199,7 @@ def test_git_with_non_editable_where_egg_contains_dev_string(script, tmpdir):
assert devserver_folder in result.files_created, str(result)
@pytest.mark.network
def test_git_with_ambiguous_revs(script):
"""
Test git with two "names" (tag/branch) pointing to the same commit
@ -204,6 +217,7 @@ def test_git_with_ambiguous_revs(script):
result.assert_installed('version-pkg', with_files=['.git'])
@pytest.mark.network
def test_git_works_with_editable_non_origin_repo(script):
# set up, create a git repo and install it as editable from a local
# directory path

View File

@ -11,6 +11,7 @@ from tests.lib.git_submodule_helpers import (
)
@pytest.mark.network
def test_get_refs_should_return_tag_name_and_commit_pair(script):
version_pkg_path = _create_test_package(script)
script.run('git', 'tag', '0.1', cwd=version_pkg_path)
@ -25,6 +26,7 @@ def test_get_refs_should_return_tag_name_and_commit_pair(script):
assert result['0.2'] == commit, result
@pytest.mark.network
def test_get_refs_should_return_branch_name_and_commit_pair(script):
version_pkg_path = _create_test_package(script)
script.run('git', 'branch', 'branch0.1', cwd=version_pkg_path)
@ -38,6 +40,7 @@ def test_get_refs_should_return_branch_name_and_commit_pair(script):
assert result['branch0.1'] == commit, result
@pytest.mark.network
def test_get_refs_should_ignore_no_branch(script):
version_pkg_path = _create_test_package(script)
script.run('git', 'branch', 'branch0.1', cwd=version_pkg_path)
@ -86,6 +89,7 @@ def test_check_rev_options_should_handle_ambiguous_commit(get_refs_mock):
# TODO(pnasrat) fix all helpers to do right things with paths on windows.
@pytest.mark.skipif("sys.platform == 'win32'")
@pytest.mark.network
def test_check_submodule_addition(script):
"""
Submodules are pulled in on install and updated on upgrade.

View File

@ -1,8 +1,10 @@
import pytest
from mock import patch
from pip.vcs.subversion import Subversion
@patch('pip.vcs.subversion.call_subprocess')
@pytest.mark.network
def test_obtain_should_recognize_auth_info_url(call_subprocess_mock, script):
svn = Subversion(url='svn+http://username:password@svn.example.com/')
svn.obtain(script.scratch_path / 'test')
@ -14,6 +16,7 @@ def test_obtain_should_recognize_auth_info_url(call_subprocess_mock, script):
@patch('pip.vcs.subversion.call_subprocess')
@pytest.mark.network
def test_export_should_recognize_auth_info_url(call_subprocess_mock, script):
svn = Subversion(url='svn+http://username:password@svn.example.com/')
svn.export(script.scratch_path / 'test')

View File

@ -96,6 +96,7 @@ def test_install_from_wheel_with_headers(script, data):
result.stdout)
@pytest.mark.network
def test_install_wheel_with_target(script, data):
"""
Test installing a wheel using pip install --target
@ -149,6 +150,7 @@ def test_install_from_wheel_no_deps(script, data):
assert pkg_folder not in result.files_created
@pytest.mark.network
def test_install_user_wheel(script, virtualenv, data):
"""
Test user install from wheel (that has a script)

View File

@ -1,4 +1,5 @@
import os
import pytest
def test_list_command(script, data):
@ -39,6 +40,7 @@ def test_user_flag(script, data, virtualenv):
assert 'simple2 (2.0)' in result.stdout
@pytest.mark.network
def test_uptodate_flag(script, data):
"""
Test the behavior of --uptodate flag in the list command
@ -60,6 +62,7 @@ def test_uptodate_flag(script, data):
assert 'simple2 (3.0)' in result.stdout, str(result)
@pytest.mark.network
def test_outdated_flag(script, data):
"""
Test the behavior of --outdated flag in the list command
@ -81,6 +84,7 @@ def test_outdated_flag(script, data):
assert 'simple2' not in result.stdout, str(result) # 3.0 is latest
@pytest.mark.network
def test_editables_flag(script, data):
"""
Test the behavior of --editables flag in the list command

View File

@ -1,3 +1,4 @@
import pytest
from pip.commands.search import (highest_version,
transform_hits,
SearchCommand)
@ -98,6 +99,7 @@ def test_invalid_pypi_transformation():
assert transform_hits(pypi_hits) == expected
@pytest.mark.network
def test_search(script):
"""
End to end test of search command.
@ -109,6 +111,7 @@ def test_search(script):
)
@pytest.mark.network
def test_multiple_search(script):
"""
Test searching for multiple packages at once.
@ -129,6 +132,7 @@ def test_search_missing_argument(script):
assert 'ERROR: Missing required argument (search query).' in result.stdout
@pytest.mark.network
def test_run_method_should_return_sucess_when_find_packages():
"""
Test SearchCommand.run for found package
@ -140,6 +144,7 @@ def test_run_method_should_return_sucess_when_find_packages():
assert status == SUCCESS
@pytest.mark.network
def test_run_method_should_return_no_matches_found_when_does_not_find_pkgs():
"""
Test SearchCommand.run for no matches
@ -151,6 +156,7 @@ def test_run_method_should_return_no_matches_found_when_does_not_find_pkgs():
assert status == NO_MATCHES_FOUND
@pytest.mark.network
def test_search_should_exit_status_code_zero_when_find_packages(script):
"""
Test search exit status code for package found
@ -159,6 +165,7 @@ def test_search_should_exit_status_code_zero_when_find_packages(script):
assert result.returncode == SUCCESS
@pytest.mark.network
def test_search_exit_status_code_when_finds_no_package(script):
"""
Test search exit status code for no matches

View File

@ -1,4 +1,5 @@
import re
import pytest
from pip import __version__
from pip.commands.show import search_packages_info
@ -49,6 +50,7 @@ def test_show_with_files_from_wheel(script, data):
assert re.search(r"Files:\n( .+\n)+", result.stdout)
@pytest.mark.network
def test_show_with_all_files(script):
"""
Test listing all files in the show command.

View File

@ -3,6 +3,7 @@ from __future__ import with_statement
import textwrap
import os
import sys
import pytest
from os.path import join, normpath
from tempfile import mkdtemp
from mock import patch
@ -12,6 +13,7 @@ from tests.lib.local_repos import local_repo, local_checkout
from pip.utils import rmtree
@pytest.mark.network
def test_simple_uninstall(script):
"""
Test simple install and uninstall.
@ -28,6 +30,7 @@ def test_simple_uninstall(script):
assert_all_changes(result, result2, [script.venv / 'build', 'cache'])
@pytest.mark.network
def test_uninstall_with_scripts(script):
"""
Uninstall an easy_installed package with scripts.
@ -45,6 +48,7 @@ def test_uninstall_with_scripts(script):
)
@pytest.mark.network
def test_uninstall_easy_install_after_import(script):
"""
Uninstall an easy_installed package after it's been imported
@ -66,6 +70,7 @@ def test_uninstall_easy_install_after_import(script):
)
@pytest.mark.network
def test_uninstall_namespace_package(script):
"""
Uninstall a distribution with a namespace package without clobbering
@ -125,6 +130,7 @@ def test_uninstall_overlapping_package(script, data):
assert_all_changes(result2, result3, [])
@pytest.mark.network
def test_uninstall_console_scripts(script):
"""
Test uninstalling a package with more files (console_script entry points,
@ -140,6 +146,7 @@ def test_uninstall_console_scripts(script):
assert_all_changes(result, result2, [script.venv / 'build', 'cache'])
@pytest.mark.network
def test_uninstall_easy_installed_console_scripts(script):
"""
Test uninstalling package with console_scripts that is easy_installed.
@ -162,6 +169,7 @@ def test_uninstall_easy_installed_console_scripts(script):
)
@pytest.mark.network
def test_uninstall_editable_from_svn(script, tmpdir):
"""
Test uninstalling an editable installation from svn.
@ -187,6 +195,7 @@ def test_uninstall_editable_from_svn(script, tmpdir):
)
@pytest.mark.network
def test_uninstall_editable_with_source_outside_venv(script, tmpdir):
"""
Test uninstalling editable install from existing source outside the venv.
@ -230,6 +239,7 @@ def _test_uninstall_editable_with_source_outside_venv(
)
@pytest.mark.network
def test_uninstall_from_reqs_file(script, tmpdir):
"""
Test uninstall from a requirements file.

View File

@ -1,6 +1,7 @@
"""
tests specific to uninstalling --user installs
"""
import pytest
from os.path import isdir, isfile
from tests.lib import pyversion, assert_all_changes
@ -9,6 +10,7 @@ from tests.functional.test_install_user import _patch_dist_in_site_packages
class Tests_UninstallUserSite:
@pytest.mark.network
def test_uninstall_from_usersite(self, script, virtualenv):
"""
Test uninstall from usersite

View File

@ -1,5 +1,6 @@
"""'pip wheel' tests"""
import os
import pytest
from os.path import exists
@ -19,6 +20,7 @@ def test_pip_wheel_fails_without_wheel(script, data):
assert "'pip wheel' requires the 'wheel' package" in result.stdout
@pytest.mark.network
def test_pip_wheel_success(script, data):
"""
Test 'pip wheel' success.
@ -33,6 +35,7 @@ def test_pip_wheel_success(script, data):
assert "Successfully built simple" in result.stdout, result.stdout
@pytest.mark.network
def test_pip_wheel_downloads_wheels(script, data):
"""
Test 'pip wheel' downloads wheels
@ -47,6 +50,7 @@ def test_pip_wheel_downloads_wheels(script, data):
assert "Saved" in result.stdout, result.stdout
@pytest.mark.network
def test_pip_wheel_builds_editable_deps(script, data):
"""
Test 'pip wheel' finds and builds dependencies of editables
@ -61,6 +65,7 @@ def test_pip_wheel_builds_editable_deps(script, data):
assert wheel_file_path in result.files_created, result.stdout
@pytest.mark.network
def test_pip_wheel_fail(script, data):
"""
Test 'pip wheel' failure.
@ -81,6 +86,7 @@ def test_pip_wheel_fail(script, data):
assert result.returncode != 0
@pytest.mark.network
def test_no_clean_option_blocks_cleaning_after_wheel(script, data):
"""
Test --no-clean option blocks cleaning after wheel build
@ -95,6 +101,7 @@ def test_no_clean_option_blocks_cleaning_after_wheel(script, data):
assert exists(build), "build/simple should still exist %s" % str(result)
@pytest.mark.network
def test_pip_wheel_source_deps(script, data):
"""
Test 'pip wheel --use-wheel' finds and builds source archive dependencies
@ -112,6 +119,7 @@ def test_pip_wheel_source_deps(script, data):
assert "Successfully built source" in result.stdout, result.stdout
@pytest.mark.network
def test_pip_wheel_fail_cause_of_previous_build_dir(script, data):
"""
Test when 'pip wheel' tries to install a package that has a previous build

View File

@ -64,6 +64,7 @@ def test_incorrect_case_file_index(data):
assert link.url.endswith("Dinner-2.0.tar.gz")
@pytest.mark.network
def test_finder_detects_latest_already_satisfied_find_links(data):
"""Test PackageFinder detects latest already satisfied using find-links"""
req = InstallRequirement.from_line('simple', None)
@ -81,6 +82,7 @@ def test_finder_detects_latest_already_satisfied_find_links(data):
finder.find_requirement(req, True)
@pytest.mark.network
def test_finder_detects_latest_already_satisfied_pypi_links():
"""Test PackageFinder detects latest already satisfied using pypi links"""
req = InstallRequirement.from_line('initools', None)
@ -290,6 +292,7 @@ def test_finder_deplink():
assert link.url.startswith("https://pypi"), link
@pytest.mark.network
def test_finder_priority_page_over_deplink():
"""
Test PackageFinder prefers page links over equivalent dependency links

View File

@ -270,6 +270,7 @@ def test_parse_editable_local_extras(
)
@pytest.mark.network
def test_remote_reqs_parse():
"""
Test parsing a simple remote requirements file