Commit 4a5f856d authored by Paul Ganssle's avatar Paul Ganssle Committed by GitHub

Merge pull request #1613 from pganssle/fix_doctest

Import distribution in doctest
parents 0902f02d a0735f22
......@@ -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'
......
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment