Merge pull request #9408 from jdufresne/setup-no-remote

Handle ._get_svn_url_rev() returning None in .get_remote_url()
This commit is contained in:
Stéphane Bidoul 2021-01-01 19:32:21 +01:00 committed by GitHub
commit a61cb200b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 1 deletions

View File

@ -128,7 +128,11 @@ class Subversion(VersionControl):
)
raise RemoteNotFoundError
return cls._get_svn_url_rev(location)[0]
url, _rev = cls._get_svn_url_rev(location)
if url is None:
raise RemoteNotFoundError
return url
@classmethod
def _get_svn_url_rev(cls, location):

View File

@ -15,3 +15,17 @@ def test_get_remote_url__no_remote(script, tmpdir):
with pytest.raises(RemoteNotFoundError):
Subversion().get_remote_url(repo_dir)
@need_svn
def test_get_remote_url__no_remote_with_setup(script, tmpdir):
repo_dir = tmpdir / 'temp-repo'
repo_dir.mkdir()
setup = repo_dir / "setup.py"
setup.touch()
repo_dir = str(repo_dir)
_create_svn_repo(script, repo_dir)
with pytest.raises(RemoteNotFoundError):
Subversion().get_remote_url(repo_dir)