diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-26 08:29:56 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-26 08:29:56 -0500 |
| commit | 732f5e89a8e417ff536d9a51a85d7b328e80dab1 (patch) | |
| tree | 29e58301a9c87b5d0bfa891b51f82784d522693a /setuptools/tests/test_easy_install.py | |
| parent | 57d6e0fc1ff66e5569296af5cf409cbbcf025148 (diff) | |
| download | python-setuptools-git-732f5e89a8e417ff536d9a51a85d7b328e80dab1.tar.gz | |
Add test capturing Attribute error. Ref #339.
Diffstat (limited to 'setuptools/tests/test_easy_install.py')
| -rw-r--r-- | setuptools/tests/test_easy_install.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index ab6a8f0d..4331d30e 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -13,6 +13,7 @@ import contextlib import tarfile import logging import itertools +import distutils.errors import pytest try: @@ -110,6 +111,16 @@ class TestEasyInstallTest: keys = sorted(cmd.package_index.scanned_urls.keys()) assert keys == ['link1', 'link2'] + def test_write_exception(self): + """ + Test that `cant_write_to_target` is rendered as a DistutilsError. + """ + dist = Distribution() + cmd = ei.easy_install(dist) + cmd.install_dir = os.getcwd() + with pytest.raises(distutils.errors.DistutilsError): + cmd.cant_write_to_target() + class TestPTHFileWriter: def test_add_from_cwd_site_sets_dirty(self): |
