Skip to content
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

Skip running svn tests when svn isn't installed #7193

Merged
merged 3 commits into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions news/7193.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Skip running tests which require subversion, when svn isn't installed
3 changes: 2 additions & 1 deletion tests/functional/test_freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
_git_commit,
need_bzr,
need_mercurial,
need_svn,
path_to_url,
)

Expand Down Expand Up @@ -169,7 +170,7 @@ def test_freeze_editable_git_with_no_remote(script, tmpdir, deprecated_python):
_check_output(result.stdout, expected)


@pytest.mark.svn
@need_svn
def test_freeze_svn(script, tmpdir):
"""Test freezing a svn checkout"""

Expand Down
3 changes: 2 additions & 1 deletion tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
create_test_package_with_setup,
need_bzr,
need_mercurial,
need_svn,
path_to_url,
pyversion,
pyversion_tuple,
Expand Down Expand Up @@ -251,7 +252,7 @@ def test_basic_editable_install(script):
assert not result.files_updated


@pytest.mark.svn
@need_svn
def test_basic_install_editable_from_svn(script):
"""
Test checking out from svn.
Expand Down
3 changes: 2 additions & 1 deletion tests/functional/test_install_reqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from tests.lib import (
_create_test_package_with_subdirectory,
need_svn,
path_to_url,
pyversion,
requirements_file,
Expand Down Expand Up @@ -100,7 +101,7 @@ def test_relative_requirements_file(script, data):


@pytest.mark.network
@pytest.mark.svn
@need_svn
def test_multiple_requirements_files(script, tmpdir):
"""
Test installing from multiple nested requirements files.
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_install_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest

from tests.lib import pyversion
from tests.lib import need_svn, pyversion
from tests.lib.local_repos import local_checkout


Expand Down Expand Up @@ -41,7 +41,7 @@ def test_reset_env_system_site_packages_usersite(self, script):
assert 'INITools' == project_name, project_name

@pytest.mark.network
@pytest.mark.svn
@need_svn
def test_install_subversion_usersite_editable_with_distribute(
self, script, tmpdir):
"""
Expand Down
9 changes: 7 additions & 2 deletions tests/functional/test_uninstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@

from pip._internal.req.constructors import install_req_from_line
from pip._internal.utils.misc import rmtree
from tests.lib import assert_all_changes, create_test_package_with_setup
from tests.lib import (
assert_all_changes,
create_test_package_with_setup,
need_svn,
)
from tests.lib.local_repos import local_checkout, local_repo


Expand Down Expand Up @@ -289,6 +293,7 @@ def test_uninstall_easy_installed_console_scripts(script):


@pytest.mark.network
@need_svn
def test_uninstall_editable_from_svn(script, tmpdir):
"""
Test uninstalling an editable installation from svn.
Expand Down Expand Up @@ -352,7 +357,7 @@ def _test_uninstall_editable_with_source_outside_venv(


@pytest.mark.network
@pytest.mark.svn
@need_svn
def test_uninstall_from_reqs_file(script, tmpdir):
"""
Test uninstall from a requirements file.
Expand Down
6 changes: 6 additions & 0 deletions tests/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,12 @@ def need_bzr(fn):
)(fn))


def need_svn(fn):
return pytest.mark.svn(need_executable(
'Subversion', ('svn', '--version')
)(fn))


def need_mercurial(fn):
return pytest.mark.mercurial(need_executable(
'Mercurial', ('hg', 'version')
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from pip._internal.vcs.mercurial import Mercurial
from pip._internal.vcs.subversion import Subversion
from pip._internal.vcs.versioncontrol import RevOptions, VersionControl
from tests.lib import is_svn_installed, pyversion
from tests.lib import is_svn_installed, need_svn, pyversion

if pyversion >= '3':
VERBOSE_FALSE = False
Expand Down Expand Up @@ -411,7 +411,7 @@ def test_subversion__init_use_interactive(
assert svn.use_interactive == expected


@pytest.mark.svn
@need_svn
def test_subversion__call_vcs_version():
"""
Test Subversion.call_vcs_version() against local ``svn``.
Expand Down