From b78994aa19ae0705f60e3b4b1e4087ecbe4ff0f5 Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Fri, 28 Dec 2018 09:37:55 -0500 Subject: Import distribution in doctest Fixes GH issue #1612, bug introduced in commit 0902f02d9d68f18 --- setuptools/command/develop.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index 707494eb..009e4f93 100644 --- a/setuptools/command/develop.py +++ b/setuptools/command/develop.py @@ -202,6 +202,7 @@ class VersionlessRequirement: name as the 'requirement' so that scripts will work across multiple versions. + >>> from pkg_resources import Distribution >>> dist = Distribution(project_name='foo', version='1.0') >>> str(dist.as_requirement()) 'foo==1.0' -- cgit v1.2.1 From a0735f223b82695cc45eb127e072496aa1dbe8f0 Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Fri, 28 Dec 2018 09:52:02 -0500 Subject: Assert that warning is raised with svn downloads This both prevents the warning from surfacing during the tests and ensures that no regressions occur. --- setuptools/tests/test_packageindex.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py index b7276682..13cffb7e 100644 --- a/setuptools/tests/test_packageindex.py +++ b/setuptools/tests/test_packageindex.py @@ -7,6 +7,7 @@ import distutils.errors from setuptools.extern import six from setuptools.extern.six.moves import urllib, http_client import mock +import pytest import pkg_resources import setuptools.package_index @@ -266,8 +267,9 @@ class TestPackageIndex: url = 'svn+https://svn.example/project#egg=foo' index = setuptools.package_index.PackageIndex() - with mock.patch("os.system") as os_system_mock: - result = index.download(url, str(tmpdir)) + with pytest.warns(UserWarning): + with mock.patch("os.system") as os_system_mock: + result = index.download(url, str(tmpdir)) os_system_mock.assert_called() -- cgit v1.2.1